Skip to content

Instantly share code, notes, and snippets.

View elfenlaid's full-sized avatar
🐧
Slow Distillation ⚗️💭

Egor Mihnevich elfenlaid

🐧
Slow Distillation ⚗️💭
View GitHub Profile
@elfenlaid
elfenlaid / xcodebuild flags.md
Created December 20, 2016 14:12 — forked from mtauraso/xcodebuild flags.md
Xcodebuild flags in CI

Xcodebuild flag reference for CI:

Required flags:

-project OR -workspace

What xcode project/workspace file we're using. If you specify a project on the command-line and that project has an associated workspace, the project is still aware of its existence within the workspace. As an example, worspace level schemes will be available to xcodebuild even if you specify a project on the command line.

-scheme

Specify the scheme to use for build. Schemes specify multiple build/test targets along with environment args and command line parameters. Schemes must be marked "shared" in the xcode UI in order to be available to xcodebuild. For any particular build/test action there is a default configuration when you use a scheme from the Xcode UI.

@elfenlaid
elfenlaid / xcodebuild flags.md
Created December 20, 2016 14:12 — forked from mtauraso/xcodebuild flags.md
Xcodebuild flags in CI

Xcodebuild flag reference for CI:

Required flags:

-project OR -workspace

What xcode project/workspace file we're using. If you specify a project on the command-line and that project has an associated workspace, the project is still aware of its existence within the workspace. As an example, worspace level schemes will be available to xcodebuild even if you specify a project on the command line.

-scheme

Specify the scheme to use for build. Schemes specify multiple build/test targets along with environment args and command line parameters. Schemes must be marked "shared" in the xcode UI in order to be available to xcodebuild. For any particular build/test action there is a default configuration when you use a scheme from the Xcode UI.

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Bencoding where
import Control.Applicative
import Crypto.Hash.SHA1
import Data.Attoparsec.ByteString.Char8 (Parser)
import qualified Data.Attoparsec.ByteString.Char8 as P
import Data.ByteString as B
import Data.ByteString.Char8 as BC
######################
# Options
######################
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
@elfenlaid
elfenlaid / client.hs
Last active August 29, 2015 14:17 — forked from mpickering/client.hs
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
module Main
( main
) where
--------------------------------------------------------------------------------
import Control.Concurrent (forkIO)
import Control.Applicative ((<$>))
@elfenlaid
elfenlaid / Fuckup.m
Created May 30, 2014 15:42
Simple copypaste became the reason of interesting debug story :)
+ (UIImage *)generatedBackground {
static NSArray *colors = nil;
if (!colors) {
colors = @[
[UIColor colorWithRed:0.957 green:0.138 blue:0.287 alpha:1.000],
...
[UIColor colorWithRed:0.972 green:0.207 blue:0.225 alpha:1.000],
];
}
@elfenlaid
elfenlaid / OperationExample.m
Created May 15, 2014 11:32
Operation example
@interface MyAsyncOperation ()
@property (nonatomic) BOOL isExecuting;
@property (nonatomic) BOOL isFinished;
@end
@implementation MyAsyncOperation
- (void)start {
self.isFinished = NO;
self.isExecuting = YES;
@elfenlaid
elfenlaid / translate.clj
Created March 24, 2014 13:47
first useful script on clojure :)
(ns translate.core
(:use clojure-csv.core))
(defonce store (parse-csv (slurp "resources/trans.csv")))
(def lang-shortcuts { "Russian" "ru"
"French" "fr"
"Italian" "it"
"German" "de"
"Spanish" "es"
@elfenlaid
elfenlaid / user.el
Last active January 3, 2016 12:29
Move region up\down
;;; Move region
(defun selected-text ()
(let ((text (if (region-active-p)
(vector (buffer-substring-no-properties (region-beginning) (region-end))
(region-beginning) (region-end))
nil)))
(if (null text) (unit-at-cursor 'line) text)))
(defun move-line (start end n)
@elfenlaid
elfenlaid / cvs_parse.clj
Last active December 31, 2015 17:19
clojure file processing
(defn lazy-open [file]
(letfn [(helper [rdr]
(lazy-seq
(if-let [line (.readLine rdr)]
(cons line (helper rdr))
(do (.close rdr) (println "closed") nil))))]
(do (println "opening")
(helper (clojure.java.io/reader file)))))
(defn parse-cvs [seq]