This file contains 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
# Misc python tips from https://book.pythontips.com/en/latest/index.html | |
################################################### | |
# *args | |
def test_var_args(f_arg, *argv): | |
print("first normal arg:", f_arg) | |
for arg in argv: | |
print("another arg through *argv:", arg) | |
# test_var_args('yasoob', 'python', 'eggs', 'test') | |
# first with *args |
This file contains 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
# Load oh-my-zsh first | |
source $ZSH/oh-my-zsh.sh | |
# If we are on a big repo, re-define git prompt | |
function git_prompt_info() { | |
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then | |
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ | |
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0 | |
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX" | |
fi |
This file contains 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 -e | |
# | |
# package-ipa.sh | |
# | |
# Bundles an iOS app correctly, using the same directory structure that Xcode does when using the export functionality. | |
# | |
xcarchive="$1" | |
output_ipa="$2" |
This file contains 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
--Authored by Grant Slatton on 2013 October 10 | |
--All code is released to the public domain under the terms of [http://unlicense.org/] | |
import Data.List | |
import Control.Monad | |
import Data.Maybe | |
import Data.Function | |
magicSquare = [8,1,6,3,5,7,4,9,2] |
This file contains 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
ּ_בּ | |
בּ_בּ | |
טּ_טּ | |
כּ‗כּ | |
לּ_לּ | |
מּ_מּ | |
סּ_סּ | |
תּ_תּ | |
٩(×̯×)۶ | |
٩(̾●̮̮̃̾•̃̾)۶ |
This file contains 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
{ | |
"name": "Mantle", | |
"version": "2.0", | |
"summary": "Model framework for Cocoa and Cocoa Touch.", | |
"homepage": "https://github.com/Mantle/Mantle", | |
"license": "MIT", | |
"authors": { | |
"GitHub": "[email protected]" | |
}, | |
"source": { |
This file contains 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
+ (UIImage *)decompressedImageWithImage:(UIImage *)image resizeTo:(CGSize)targetSize | |
{ | |
CGImageRef imageRef = image.CGImage; | |
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); | |
CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef); | |
BOOL sameSize = NO; | |
if (CGSizeEqualToSize(targetSize, CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)))) { | |
targetSize = CGSizeMake(1, 1); | |
sameSize = YES; | |
} |
This file contains 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/zsh | |
arch=x86_64 | |
os=osx | |
kernel=darwin | |
compiler=ghc | |
version=7.8.3 | |
user=~/.ghc/$arch-$kernel-$version/package.conf.d | |
target=myhaskell.docset | |
dash_path="~/Library/Application Support/Dash/DocSets/Haskell/" |
This file contains 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
{-# LANGUAGE OverloadedStrings, DeriveGeneric #-} | |
import Data.Aeson ((.:), (.:?), decode, encode, FromJSON(..), ToJSON(..), Value(..)) | |
import Data.Aeson.Encode.Pretty | |
import qualified Data.ByteString.Lazy as BS (readFile, writeFile) | |
import Control.Applicative ((<$>), (<*>)) | |
import Control.Monad.IO.Class | |
import Control.Monad |
This file contains 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
cleanup = "!git branch --merged | grep -v '\\*\\|master\\|develop' | xargs -n 1 git branch -d" | |
cleanupr = "!git fetch --prune ; git branch -r --merged | grep origin | grep -v '>' | grep -v '\\*\\|master\\|develop' | xargs -L1 | cut -d"/" -f2- | xargs git push origin --delete" |
NewerOlder