⌘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 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
The MIT License (MIT) | |
Copyright (c) 2016 Stuart Powers | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
import numpy | |
import subprocess | |
weighted_edge_dtype = [("n1", numpy.uint32),("n2", numpy.uint32),("weight", numpy.float64)] | |
def convert_edgelist_to_mmap(in_filename): | |
# First determine number of edges because we will need to | |
# pre-allocate memmap object and that action requires a size | |
# Use unix's wc (WordCount) to count lines because it is |
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
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
execfile("/your/path/to/videomaker.py") | |
videomaker( | |
ts_min=1352261778000, # "from" timestamp.. | |
ts_max=1352262378000, # .."to" timestamp | |
frames=20, # number of images in the video. eg 200 frames for a video at 20 frames per seconds = 10 seconds of video | |
output_prefix="/path/to/output/dir/frame_", # path where to write the png. images will be prefixed with "frame_" | |
output_format=".png" # you probably want to leave png here | |
) |
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
// Create our stage canvas. | |
var stage = document.createElement('canvas'); | |
stage.style.border = '1px solid #000'; | |
document.body.appendChild(stage); | |
// Create offscreen buffer for our text rendering. | |
// This way all we have to do is draw our buffer to | |
// the main canvas rather than drawing text each frame. | |
var textBuffer = document.createElement('canvas'); |
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
sigi = sigma.instances[1]; | |
var prefix = /.{7}/; | |
sigi.iterNodes(function (node) { | |
node.label = node.attr.kind + ": " + node.attr.name.replace(prefix, ''); | |
}); | |
WebFontConfig = { | |
google: { families: [ 'Lato::latin' ] } |
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
// create nodes | |
// create BaseNodes | |
import-cypher -d ; -i ./IMPORT/INPUT/1-basenodes.csv -o ./IMPORT/OUTPUT/nodeoutput.csv create (n:#{type} {id:{id},name:{name}}) return n | |
// create indexes | |
create index on :INGREDIENT_CATEGORY(name); | |
create index on :INGREDIENT(name); | |
create index on :INGREDIENT(id); | |
create index on :COMPOUND(name); | |
create index on :COMPOUND(id); |
OlderNewer