Skip to content

Instantly share code, notes, and snippets.

{
"version": "0.2.0",
"configurations": [
{
"name": "SimpleHTTPServer",
"type": "python",
"request": "launch",
"stopOnEntry": false,
"program": "${workspaceRoot}/server.py",
"debugOptions": [
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):
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)");
}
<!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">
#!/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}" }
x=0; loop { print %x{clear}; x>80 ? x=0 : x+=10; puts " "*x + ":3"; sleep 1 }
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
http://help.apple.com/osx-yosemite/whats-new/from-lion/
{
"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&hellip;",
"direction": "ltr",
"word_count": 1525,
"total_pages": 0,
#!/bin/sh
ruby -rwebrick -e 'WEBrick::Config::HTTP[:MimeTypes]["rhtml"] = "text/html"' -run -e httpd -- --port=8000 .