$ nvm use 0.10
$ npm init
$ npm install grunt --save-dev
$ npm install grunt-contrib-cssmin --save-dev
$ npm install grunt-contrib-sass --save-dev
$ npm install grunt-contrib-uglify --save-dev
$ npm install grunt-wiredep --save-dev
# edit Gruntfile.js
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
final AutoCloseInputStream stream = new AutoCloseInputStream(pData); | |
try { | |
final FileChannel channel = stream.getChannel(); | |
final MappedByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size()); | |
session.send(SERVER_EID, 100, | |
Charset.defaultCharset().decode(buf).toString()); | |
} | |
finally { | |
stream.close(); |
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 Base(models.Model): | |
myfield = models.PositiveIntegerField() | |
class Meta: | |
abstract = True | |
class Dummy(Base): | |
pass |
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
from CGAL.CGAL_Kernel import Point_2, Segment_2 | |
from CGAL.CGAL_Sweep_line_2 import \ | |
compute_intersection_points, \ | |
compute_subcurves, \ | |
do_curves_intersect,\ | |
test_segment_range | |
segments = [ | |
Segment_2(Point_2(0, 0), Point_2(10, 10)), |
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
BASE_DIR=$PWD | |
echo "create SVN repositories" | |
for i in {1..2}; do | |
svnadmin create $BASE_DIR/svn-repo$i | |
svn checkout file://$BASE_DIR/svn-repo$i $BASE_DIR/svn-client$i | |
mkdir $BASE_DIR/svn-client$i/{trunk,branches,tags} | |
echo "file $i" > $BASE_DIR/svn-client$i/trunk/file$i.txt |
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
public static int[] process(int[] inp, String oop) { | |
// initialize a new array with zeroes to use in error case <-- WRONG! | |
// this will be returned if the operator is not known <-- WRONG! | |
int[] oue = new int[] { Integer.MAX_VALUE, Integer.MAX_VALUE }; | |
// set placeholder variable for plus operator | |
// this will be used to compare the input operator in the for loop below | |
String opp = "+"; | |
// set placeholder variable for minus operator | |
// this will be used to compare the input operator in the for loop below | |
String opm = "-"; |
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 importlib | |
import inspect | |
import pkgutil | |
package = importlib.import_module(__package__) | |
for loader, module_name, is_pkg in pkgutil.iter_modules(package.__path__): | |
if not is_pkg: | |
module = importlib.import_module(__package__+'.'+module_name) | |
for name, obj in inspect.getmembers(module): | |
if inspect.isclass(obj): |
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
var jsen = require('jsen'); | |
function validateAndOutput(schema, title, data) { | |
var validate = jsen(schema); | |
var result = validate(data); | |
if (result) { | |
console.log('Valid: ' + title + ' = ' + JSON.stringify(data)); | |
} else { | |
console.log('Invalid: ' + title + ' = ' + JSON.stringify(data)); |
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() { | |
function d3_class(ctor, properties) { | |
try { | |
for (var key in properties) { | |
Object.defineProperty(ctor.prototype, key, { | |
value: properties[key], | |
enumerable: false | |
}); | |
} | |
} catch (e) { |
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"> | |
<title>Grow and Shrink</title> | |
</head> | |
<body> | |
<svg width="100%" height="100%"> | |
<animate id="shrink" |
OlderNewer