Skip to content

Instantly share code, notes, and snippets.

View xslim's full-sized avatar

Taras Kalapun xslim

View GitHub Profile
@xslim
xslim / printClassMethods.m
Last active August 29, 2015 13:56
printClassMethods method
#if TARGET_OS_IPHONE
#import <objc/runtime.h>
#else
#import <objc/objc-class.h>
#endif
+ (void)printClassMethods {
@autoreleasepool {
NSMutableString *ms = nil;
@xslim
xslim / cheat.sh
Created February 17, 2014 08:59
Using `.md` files in `~/.cheats` as cheat sheet
#!/bin/bash
CHEAT_PATH=${HOME}/.cheats
list_pages() {
IFS=":"
local paths="$CHEAT_PATH"
echo
printf " \033[1m pages:\033[0m\n"
@xslim
xslim / HomeViewController.m
Last active August 29, 2015 13:56
PixateFreestyle Live editing
#ifdef DEBUG
#import <PixateFreestyle/PixateFreestyle.h>
#endif
// in @implementation
#pragma mark - Shake
#ifdef DEBUG
- (BOOL) canBecomeFirstResponder {
return YES;
@xslim
xslim / backup_remote_db.sh
Created March 6, 2014 16:41
Simple mongo backup & tar with current date & time
#!/bin/bash
HOST="paulo.mongohq.com"
PORT=10036
USERNAME="heroku"
PASSWORD=""
DB="app123"
DATE=`date +%Y-%m-%d-%H-%M-%S`
@xslim
xslim / gist:9688087
Created March 21, 2014 14:58
Sorting NSArray by other array
NSDictionary *openingHours;
NSArray *days = @[@"Ma", @"Di", @"Wo", @"Do", @"Vr", @"Za", @"Zo"];
NSArray *sortedUserDays = [[openingHours allKeys] sortedArrayUsingComparator:^(NSString *a, NSString *b) {
return [@([days indexOfObject:[a substringToIndex:2]]) compare:@([days indexOfObject:[b substringToIndex:2]])];
}];
@xslim
xslim / hasher.js
Last active August 29, 2015 13:57
requirebin sketch
var CryptoJS = require('crypto-js')
var Base64 = {
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
encode: function(input) {
var output = "", chr1, chr2, chr3, enc1, enc2, enc3, enc4, i = 0;
//input = String(input);
while (i < input.length) {
@xslim
xslim / Gemfile
Created March 31, 2014 16:32
Appium
source "https://www.rubygems.org"
gem "rest-client"
gem "rspec"
gem "selenium-webdriver"
gem "cucumber"
gem "rspec-expectations"
@xslim
xslim / README.md
Last active August 29, 2015 13:57
Bump JIRA issues with Build number + put them in state 5

Install

  1. Install npm
  2. npm install -g git://github.com/xslim/jilla.git
  3. chmod +x jira_bump
  4. Run first jilla
$ jira_bump 
Can bump with status 731: EMTEL-1193, EMTEL-1334, EMTEL-1212, EMTEL-689, EMTEL-1195, EMTEL-1093
@xslim
xslim / .xctool-args
Created April 2, 2014 16:34
Appium console
[
"-workspace", "EMTE.xcworkspace",
"-scheme", "EMTE",
"-configuration", "Debug",
"-sdk", "iphonesimulator",
"-arch", "i386",
"OBJROOT=$(PWD)/build",
"SYMROOT=$(PWD)/build"
]
@xslim
xslim / mapper.js
Created April 9, 2014 13:40
JS Mapper
function mapJSON2Object1(json, object, mapping) {
var obj;
if (typeof object == 'string') {
try {
obj = new this[object]();
} catch (err) {
try {
//Obj-C thing
obj = this[object].new();