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
| # backup current staging | |
| $ git checkout staging | |
| $ git branch tmp | |
| # reset to master and merge hotfix | |
| $ git reset --hard master | |
| $ git merge hotfix/xxx | |
| $ git push --force origin staging | |
| # deploy to production |
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/sh | |
| ruby -rwebrick -e 'WEBrick::Config::HTTP[:MimeTypes]["rhtml"] = "text/html"' -run -e httpd -- --port=8000 . |
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
| { | |
| "domain": "jeffhuang.com", | |
| "next_page_id": null, | |
| "url": "http://jeffhuang.com/extracting_my_data_from_the_microsoft_band.html", | |
| "short_url": "http://rdd.me/9ygl8ypc", | |
| "author": null, | |
| "excerpt": "When the Microsoft Band was announced, I was thrilled to discover the first wrist-worn device to have both a heart-rate sensor and GPS, plus a slew of other sensors. My research group has been…", | |
| "direction": "ltr", | |
| "word_count": 1525, | |
| "total_pages": 0, |
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
| http://help.apple.com/osx-yosemite/whats-new/from-lion/ |
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
| require_relative 'model' | |
| require 'pry' | |
| MONTHLY_RATE = 5 # per user | |
| class User < Model | |
| attr_accessor :username | |
| has_many :members | |
| has_many :created_projects, class_name: "Project", foreign_key: :creator_id |
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
| x=0; loop { print %x{clear}; x>80 ? x=0 : x+=10; puts " "*x + ":3"; sleep 1 } |
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 | |
| commit_logs = $stdin.read | |
| pull_requests = commit_logs.scan(/Merge pull request (#\d+) from \w+\/(\S+)$/) | |
| pull_requests.each { |(number, branch)| $stdout.puts "* #{number} #{branch}" } |
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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Mithril</title> | |
| <!-- stylesheet --> | |
| <link href="//fonts.googleapis.com/css?family=Raleway" rel="stylesheet"> |
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 findSolution(target) { | |
| function find(start, history) { | |
| if (start == target) | |
| return history; | |
| else if (start > target) | |
| return null; | |
| else | |
| return find(start + 5, "(" + history + " + 5)") || | |
| find(start * 3, "(" + history + " * 3)"); | |
| } |
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
| class Item(object): | |
| def __init__(self, name, value, weight): | |
| self.name = name | |
| self.value = value | |
| self.weight = weight | |
| def __repr__(self): | |
| return '<' + self.name + '>' | |
| def getValue(self): |