Garlic – A drag-n-drop Remote Configuration Framework for iOS (objective-c)

Features:

  • Easy 1-line integration
  • ZERO libraries required (not even AFNetworking!)
  • Remote feature flags
  • Local settings fallback
  • Custom remote settings
  • Force updates
  • No collisions with other frameworks

Setup:

In most cases, you want to load remote settings either in the lifecycle events in your AppDelegate or ViewController, or anywhere else you like:

  1. #import “Garlic.h”
  2. Init and setup Garlic with a remote settings plist URL and a completion block: [[Garlic sharedInstance] setupWithRemoteConfigURL:@”{{your-remote-settings-plist-url-here.com}}” completionHandler:^(void){ // code to run when setup was done }

Force update:

Determine if the app should be updated, based on build numbers

if ([[Garlic sharedInstance] shouldForceUpdateApp]) { // ask user to update app }

Feature flags:

Check if a feature should be activated

if ([[Garlic sharedInstance] shouldAllowFeature:@”{{your-feature-name-here}}”]) { // show the button/menu that enables that feature}

Custom values:

Get remote values for your custom purposes

NSString *tipOfTheDay = [[Garlic sharedInstance] getSettingForKey:@”TipOfTheDay-2015-11-27″]

Future features:

  1. Force synchronous url request
  2. Load settings from JSONs and XMLs, in addition to plists
  3. POST remote settings: change remote settings in the server when shaking the device
  4. Web-based remote settings editor
  5. Push updates: engage a remote settings update using a push notification
  6. Targeted Feature Flags: toggle features for specific user IDs, geolocations, device models..

Made with ❤ by Nur Nachman – nur.xyz

Copy to clipboard

While working on the Baking Blogger’s special characters panel, I needed a way to copy the selected character to the clipboard. I used the following technique:
import java.awt.Toolkit;
import java.awt.datatransfer.*;

TextTransfer clipBoard = new TextTransfer();

Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(stringSelection, this);
clipBoard.setClipboardContents(button4.getText());

class TextTransfer implements ClipboardOwner {
@Override
public void lostOwnership(Clipboard clipboard, Transferable contents) {
}

public void setClipboardContents(String aString) {
StringSelection stringSelection = new StringSelection(aString);
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(stringSelection, this);
}
}



Start with writing a class that implements the ClipboardOwner interface. This enforces you to implement the method setClipaordContents(String string){}

Stock Exhange Fraud Detection

lately started to find interest in the stock market and working in an anti fraud solutions company, i thought of aome ways to find fraud on the market.

first step would be to define a most-fake identity of investor/trader. this most-fake investor would be too goot to be true. in any of the following cases, a too-good-to-be-true trader can be identified using repeating patterns, and mitigated:

1. inside trading – criminal trading based on knowledge from inside the company.

2. runner up – a legitimate investor asks their broker for a certain trade and the broker criminally executes the trade themselves before the customers order.

3. pumping – criminally inflating certain stocks to make them seem a good investment – and exiting position when the legitimate market reaponds.

these are just some examples of the possible criminal activity that can be found in stock exhange fraud, and we can find patterns and develop models that can identify them in near-real-time