This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
### | |
# This utility adds missing parentheses to single word function calls | |
# that are now treated as warnings on Elixir 1.4. | |
# | |
# Download this file on your project repo and execute | |
# ruby ex14parens.rb --help | |
#### | |
require('fileutils') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Map.Helpers do | |
@moduledoc """ | |
Functions to transform maps | |
""" | |
@doc """ | |
Convert map string camelCase keys to underscore_keys | |
""" | |
def underscore_keys(nil), do: nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------- | |
# Colors | |
# ---------------------------------- | |
NOCOLOR='\033[0m' | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
ORANGE='\033[0;33m' | |
BLUE='\033[0;34m' | |
PURPLE='\033[0;35m' | |
CYAN='\033[0;36m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mySlowFunction(baseNumber) { | |
console.time('mySlowFunction'); | |
let result = 0; | |
for (var i = Math.pow(baseNumber, 7); i >= 0; i--) { | |
result += Math.atan(i) * Math.tan(i); | |
}; | |
console.timeEnd('mySlowFunction'); | |
} | |
mySlowFunction(8); // higher number => more iterations => slower |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config :my_app, :twitter_api, | |
client: Twitter.SandboxClient |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script builds the iOS and Mac openSSL libraries | |
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script | |
# Credits: | |
# https://github.com/st3fan/ios-openssl | |
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ## inserting. this can be done in viewDidLoad | |
// this can be any view, here I'm adding to main view | |
UIView *containerView = self.view; | |
// load child controller | |
UIViewController *svc = [[UIViewController alloc] initWithNibName:nil bundle:nil]; | |
// kill the randomness | |
svc.view.translatesAutoresizingMaskIntoConstraints = NO; | |
// add child VC to hierarchy | |
[self addChildViewController:svc]; | |
// set initial rect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- include/llvm-c/Core.h 2010-03-04 08:51:25.000000000 +0900 | |
+++ ../llvm-2.8/include/llvm-c/Core.h 2010-08-28 13:09:24.000000000 +0900 | |
@@ -204,8 +204,7 @@ | |
LLVMPointerTypeKind, /**< Pointers */ | |
LLVMOpaqueTypeKind, /**< Opaque: type with unknown structure */ | |
LLVMVectorTypeKind, /**< SIMD 'packed' format, or other vector type */ | |
- LLVMMetadataTypeKind, /**< Metadata */ | |
- LLVMUnionTypeKind /**< Unions */ | |
+ LLVMMetadataTypeKind /**< Metadata */ | |
} LLVMTypeKind; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lisp.rb - The LISP expressed with Ruby | |
# | |
# * Program code can be written in Ruby's data structures (Array, Symbol, ...) | |
# * LISP-2 (http://en.wikipedia.org/wiki/Lisp-1_vs._Lisp-2#The_function_namespace) | |
# | |
# "THE ROOTS OF LISP" by Paul Graham | |
# http://www.paulgraham.com/rootsoflisp.html | |
# | |
require 'strscan' |
NewerOlder