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 / 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 / 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 / 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 ((<$>))
######################
# Options
######################
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
{-# 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
@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.

git config --global alias.trim '!f() { git branch | grep -v "\*" | xargs -n 1 git branch -D; }; f'
@elfenlaid
elfenlaid / test.json
Last active February 8, 2019 20:28
vscode elixir test setup
{
"version": "2.0.0",
"tasks": [
{
"label": "mix test all",
"type": "shell",
"command": "mix",
"args": ["test", "--color", "--trace"],
"options": {
"cwd": "${workspaceRoot}",
// Place your key bindings in this file to overwrite the defaults
[{
"key": "shift+ctrl+p",
"command": "cursorUpSelect",
"when": "editorTextFocus"
},
{
"key": "shift+ctrl+f",
"command": "cursorRightSelect",
"when": "editorTextFocus"