Instantly share code, notes, and snippets.

View vscode-bindings.js
// 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"
@elfenlaid
elfenlaid / test.json
Last active Feb 8, 2019
vscode elixir test setup
View test.json
{
"version": "2.0.0",
"tasks": [
{
"label": "mix test all",
"type": "shell",
"command": "mix",
"args": ["test", "--color", "--trace"],
"options": {
"cwd": "${workspaceRoot}",
View gist:b8335a85b76d72370545fd182969075a
git config --global alias.trim '!f() { git branch | grep -v "\*" | xargs -n 1 git branch -D; }; f'
View xcodebuild flags.md

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.

View xcodebuild flags.md

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.

View Bencoding.hs
{-# 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
View gist:060f2e5840d9cc2e1a01
######################
# Options
######################
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
View client.hs
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
module Main
( main
) where
--------------------------------------------------------------------------------
import Control.Concurrent (forkIO)
import Control.Applicative ((<$>))
@elfenlaid
elfenlaid / Fuckup.m
Created May 30, 2014
Simple copypaste became the reason of interesting debug story :)
View Fuckup.m
+ (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],
];
}
View OperationExample.m
@interface MyAsyncOperation ()
@property (nonatomic) BOOL isExecuting;
@property (nonatomic) BOOL isFinished;
@end
@implementation MyAsyncOperation
- (void)start {
self.isFinished = NO;
self.isExecuting = YES;