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
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset | |
# Regular Colors | |
Black="\[\033[0;30m\]" # Black | |
Red="\[\033[0;31m\]" # Red | |
Green="\[\033[0;32m\]" # Green | |
Yellow="\[\033[0;33m\]" # Yellow | |
Blue="\[\033[0;34m\]" # Blue | |
Purple="\[\033[0;35m\]" # Purple |
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
grep -lr <pattern> ./<dir> | xargs sed -i '' 's/<search-for>/<replace-with>/g' |
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 | |
echo '--- --- --- --- --- --- --- --- --- --- ---' | |
echo 'Deploying site...' | |
echo '--- --- --- --- --- --- --- --- --- --- ---' | |
if ! [ -t 0 ]; then | |
read -a ref | |
fi | |
IFS='/' read -ra REF <<< "${ref[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
x='() { :;}; echo VULNERABLE' bash -c : |
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
// Present VC from Storyboard | |
// (include VC's header file) | |
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"<STORYBOARD_NAME>" bundle:nil]; | |
UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"<STORYBOARD_ID"]; | |
[self presentViewController:vc animated:FALSE completion:nil]; | |
// Call Segue from Storyboard | |
[self performSegueWithIdentifier:@"<SEGUE_ID>" sender:self]; |
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
-(void)sendEmailTo:(NSString *)to withSubject:(NSString *)subject withBody:(NSString *)body | |
{ | |
NSString *mailString = [NSString stringWithFormat:@"mailto:?to=%@&subject=%@&body=%@", | |
[to stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding], | |
[subject stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding], | |
[body stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]; | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:mailString]]; | |
} |
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
-(int)randomNumberBetween:(int)from to:(int)to | |
{ | |
return (int)from + arc4random() % (to-from+1); | |
} |
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
- '%H': commit hash | |
- '%h': abbreviated commit hash | |
- '%T': tree hash | |
- '%t': abbreviated tree hash | |
- '%P': parent hashes | |
- '%p': abbreviated parent hashes | |
- '%an': author name | |
- '%aN': author name (respecting .mailmap, see linkgit:git-shortlog[1] or linkgit:git-blame[1]) | |
- '%ae': author email | |
- '%aE': author email (respecting .mailmap, see linkgit:git-shortlog[1] or linkgit:git-blame[1]) |
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
func getRandomColor() -> SKColor | |
{ | |
var randomRed:CGFloat = CGFloat(drand48()) | |
var randomGreen:CGFloat = CGFloat(drand48()) | |
var randomBlue:CGFloat = CGFloat(drand48()) | |
return SKColor(red: randomRed, green: randomGreen, blue: randomBlue, alpha: 1.0) | |
} |
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/sh | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
fi |
OlderNewer