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
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user |
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
# Git clean repo and remove untracked files and directories. | |
git clean -fxd | |
# Count number of commits from <commit/branch> to <commit/branch> | |
git log --oneline <start_but_excluded_commit/branch>..<end_included_commit/branch> | wc |
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
# Download a file | |
curl -O http://example.com/file.txt | |
# Download a file and follow any redirection that may occurs | |
curl -LO http://example.com/file.txt | |
# Download a file to different name | |
curl -o myfile.txt http://example.com/file.txt | |
# or | |
curl http://example.com/file.txt > myfile.txt |
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
git clone [email protected]:joyent/node.git | |
cd node | |
./configure | |
make | |
make install |
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
curl https://npmjs.org/install.sh | sh |
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
// Implement this in the UITableView's subclass | |
// Please note that you have to return an instance of UITableViewHeaderFooterView's subclass in tableView:viewForHeaderInSection: | |
// | |
- (void)layoutSubviews { | |
[super layoutSubviews]; | |
NSArray *visibleRows = [self indexPathsForVisibleRows]; | |
NSMutableIndexSet *sections = [[NSMutableIndexSet alloc] init]; | |
for (NSIndexPath *indexPath in visibleRows) { | |
[sections addIndex:indexPath.section]; |
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
#!/usr/bin/env sh | |
curl https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty | grep -o "[1-9][0-9]*" | xargs -I {} curl https://hacker-news.firebaseio.com/v0/item/{}.json?print=pretty |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
) | |
func main() { |
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
package main | |
import ( | |
"bufio" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" |
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
package main | |
import ( | |
"flag" | |
"io" | |
"log" | |
"os" | |
"strconv" | |
"time" | |
) |
OlderNewer