| ⌘T | go to file |
| ⌘⌃P | go to project |
| ⌘R | go to methods |
| ⌃G | go to line |
| ⌘KB | toggle side bar |
| ⌘⇧P | command prompt |
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
| // ==UserScript== | |
| // @name redirect | |
| // @description redirect | |
| // @include http://www.vg.no/ | |
| // @include http://www.dagbladet.no/ | |
| // @version 1.0 | |
| // ==/UserScript== | |
| if (window.location == 'http://www.vg.no/') | |
| window.location = 'http://www.vg.no/nyheter/' |
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 'underscore' | |
| class FromRomanNumerals | |
| baseValues: { | |
| "I": 1 | |
| "V": 5 | |
| "X": 10 | |
| "L": 50 |
- this is a complete item
- this is an incomplete item
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
| import png | |
| import random | |
| imgsize = 900 | |
| img = [[random.randint(0, 255) for x in range(imgsize)] for y in range(imgsize)] | |
| f = open('rnd.png', 'wb') | |
| w = png.Writer(imgsize, imgsize, greyscale=True) | |
| w.write(f, img) |
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
| // A concurrent prime sieve | |
| package main | |
| // Send the sequence 2, 3, 4, ... to channel 'ch'. | |
| func Generate(ch chan<- int) { | |
| for i := 2; ; i++ { | |
| ch <- i // Send 'i' to channel 'ch'. | |
| } | |
| } |
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
| package main | |
| import ( | |
| "fmt" | |
| "github.com/PuerkitoBio/goquery" | |
| "strconv" | |
| "strings" | |
| ) | |
| func GetFloridaFloat(datarows *goquery.Selection, field int) (data float64, err error) { |
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
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "reflect" | |
| "syscall" | |
| "unsafe" | |
| ) |
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
| {Game, Player, Advantage} = require "./main" | |
| playGame = (gamedata) -> | |
| game = new Game | |
| for x in gamedata.split " " | |
| game.setAdvantage Advantage.playerA if x is "advA" | |
| game.setAdvantage Advantage.playerB if x is "advB" | |
| game.pointA() if x is "pointA" | |
| game.pointB() if x is "pointB" |
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
| Gox = require 'goxstream' | |
| JSONStream = require 'json-stream' | |
| Boxcar = require 'boxcar' | |
| osxnotify = require 'osx-notifier' | |
| log = require 'npmlog' | |
| argv = (require 'optimist') | |
| .usage('Usage: $0') | |
| .alias('h', 'high') |