Skip to content

Instantly share code, notes, and snippets.

View dmitry-salnikov's full-sized avatar

Dmitry Salnikov dmitry-salnikov

View GitHub Profile
@dmitry-salnikov
dmitry-salnikov / gist:a020f42cb1221f3c4641
Created December 15, 2015 19:02 — forked from sponno/gist:7228256
Xcode build lipo script
# define output folder environment variable
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# Step 1. Build Device and Simulator versions
xcodebuild -target ${PROJECT_NAME} ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}"
BUILD_ROOT="${BUILD_ROOT}" xcodebuild -target ${PROJECT_NAME} -configuration ${CONFIGURATION} -sdk iphonesimulator -arch i386 BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
@dmitry-salnikov
dmitry-salnikov / gist:83e1ec7cc2a7ec7582ed
Created February 3, 2016 11:36 — forked from adamgit/gist:3705459
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.7
#
# Latest Change:
# - Supports iPhone 5 / iPod Touch 5 (uses Apple's workaround to lipo bug)
#
# Purpose:
@interface DFPurchase : NSObject
@property (nonatomic, strong) NSString *currency;
@property (nonatomic, strong) NSDate *date;
@property (nonatomic, strong) NSString *orderId;
@property (nonatomic, strong) NSString *store;
@property (nonatomic, strong) NSString *purchaseDescription;
@property (nonatomic, assign) double subtotal;
@property (nonatomic, assign) double tax;
@property (nonatomic, assign) double shipping;
@dmitry-salnikov
dmitry-salnikov / cookie.js
Created March 25, 2016 11:49
js snippet for cookies read/write
@dmitry-salnikov
dmitry-salnikov / upstart_virtualenv_test.conf
Created May 3, 2016 23:09 — forked from swinton/upstart_virtualenv_test.conf
Example of an upstart job running a python script under a virtualenv
########################################
##### upstart_virtualenv_test.conf #####
##### install in /etc/init #####
########################################
description "Testing virtualenv and upstart setup"
env PYTHON_HOME=/home/steve/.virtualenvs/upstart-test
start on runlevel [2345]
@dmitry-salnikov
dmitry-salnikov / info.plist
Created May 13, 2016 14:18 — forked from mlynch/info.plist
Disable App Transport Security in iOS 9
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
FirstName // First name - kABStringPropertyType
LastName // Last name - kABStringPropertyType
MiddleName // Middle name - kABStringPropertyType
Prefix // Prefix ("Sir" "Duke" "General") - kABStringPropertyType
Suffix // Suffix ("Jr." "Sr." "III") - kABStringPropertyType
Nickname // Nickname - kABStringPropertyType
FirstNamePhonetic // First name Phonetic - kABStringPropertyType
LastNamePhonetic // Last name Phonetic - kABStringPropertyType
MiddleNamePhonetic // Middle name Phonetic - kABStringPropertyType
Organization // Company name - kABStringPropertyType
@dmitry-salnikov
dmitry-salnikov / gh2bb_migrate_cheapass.py
Created May 30, 2016 18:23
Migrate all your private github repos to bitbucket because you're CHEAP.
__author__ = 'schwa'
import os
import subprocess
import glob
from github import Github # pip install PyGithub
from bitbucket.bitbucket import Bitbucket # pip install --user bitbucket-api
GH_USERNAME = 'jwight@mac.com'
GH_PASSWORD = '1234'
@dmitry-salnikov
dmitry-salnikov / ios-questions-interview.md
Created June 1, 2016 12:59 — forked from arturlector/ios-questions-interview.md
Вопросы на собеседование iOS разработчика.

Вопросы на собеседование iOS разработчика (дополненное издание):

General:

  • Что такое полиморфизм?

  • Что такое *инкапсуляция? Что такое *нарушение инкапсуляции?

  • Чем абстрактный класс отличается от интерфейса?

  • Расскажите о паттерне MVC. Чем отличается пассивная модель от активной?

@dmitry-salnikov
dmitry-salnikov / DynamicallyTable.java
Created August 1, 2016 15:06
Dynamically Headers and Fields Table layout Android
package com.utelecard.utd_mobile.Activities.Distributors.Reports;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.view.Gravity;
import android.view.MenuItem;
import android.view.ViewGroup;
import android.widget.TableLayout;
import android.widget.TableRow;