Skip to content

Instantly share code, notes, and snippets.

Avatar
🦄
Working from home

Andre Caetano webcaetano

🦄
Working from home
View GitHub Profile
@phiresky
phiresky / .gitignore
Last active Jun 5, 2020
parity auto-kill script
View .gitignore
/node_modules
*.log
View encode_timelapse.py
#!/usr/bin/python2.7
import getopt, sys, os
def fmt(fmt, dic):
for k in dic:
fmt = fmt.replace("{" + k + "}", str(dic[k]))
return fmt
INFILE = "*.png"
OUTFILE = "timelapse.avi"
View Default (OSX).sublime-keymap
[
{ "keys": ["super+shift+q"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["super+up"], "command": "toggle_word"},
{ "keys": ["super+down"], "command": "toggle_word"},
{ "keys": ["super+shift+1"], "command": "open_terminal_project_folder" },
{
"keys": ["super+shif+e"],
"command": "chain",
"args": {
"commands": [
@shamansir
shamansir / draw_svg.js
Last active Apr 20, 2020
draw SVG path on canvas
View draw_svg.js
// take SVG commands and draw this path to HTML5 canvas
// commandList should look like that: [ { marker: "M", values: [ 10, 10 ] },
// { marker: "l", values: [ 5, 7 ] },
// { marker: "C", values: [ -5, 7.2, .3, -16, 24, 10 ] },
// . . .
// { marker: "z", values: [ ] } ]
// there's another gist which has the code to parse SVG paths:
// https://gist.github.com/shamansir/0ba30dc262d54d04cd7f79e03b281505
View blinktrade_example_restapi.py
#!/usr/bin/env python
import hashlib
import hmac
import time
import requests
import datetime
# Q. Do you have A Websocket API?
# A. Yes, and we strongly recommend you to use it. Please, check our JavaScript websocket implementation for our WebSocket API here:
# https://github.com/blinktrade/frontend/blob/master/jsdev/bitex/api/bitex.js
@winduptoy
winduptoy / roundCorners.js
Last active May 24, 2020
Paper.js – Rounded corners in plain JavaScript
View roundCorners.js
// Rounds the corners of a path in Paper.js
// Demo: http://sketch.paperjs.org/#S/lVRNj5swEP0rIy4LDSEQqRey0R52VamHqivtoYeQgxcmixXHRsawrVb8944NBfLRw3IA+c2b92bGNh+eZCf0Uu/liCYvvdDLVWHXLdNQG3ptQeI7PDNT+sEmkxbXrOBN/YsXpqRwEhOcydUKHjUyg8BcRl2yCgFb1H/goMnEUZgsQNU5F8IyTYlzsUweGpkbriQo+c3m+JQvTfCRSaDH1hNpPKkWXS0W69OpDP8HlRjVXPY5Ua4aaVbrOFgkwZeZyWbSmvUWvdDaH3zsk5MG6hRaju9RvwinaKW4NHUKydcZ2JskhMbxFby25DlcG62O+KiEIpe7V8Hy410f7YLzGjV1UrgNsEA4CFpSZwc/zmziVfQKBxpQU5lx24lvJ2rEDqtysxrWUS14jn5sFTNzFiLqbu/gg9K+FeEExSEI+oz5AuUbDZZi9yDos1gMrr1v3uhnO69Zyo7vIzfDzUST+Ntc82ABCWy3ZPgAMaTggOvkSmN7I3lJyfeU93BZrItYteUtNVvKEwrDSG2sfjlVeGF8gzrWM1BHxX/+22Ebh/go87+43RVWFPMjOh7E9MLYCYXnxJJunsCfjUknymrdi3fBZ13Gdm66fJfpxLgw6cYzlgtVY0GNGt2gi2k0jZbucNrDTT+jV/qjHPvL5qW7ffcX
// -- Translated from PaperScript to plain JavaScript. Originally by Alex Blackwood.
// -- http://stackoverflow.com/questions/25936566/paper-js-achieving-smoother-edges-with-closed-paths
function roundCorners(path,radius) {
var segments = path.segments.slice(0);
path.remov
@theprojectsomething
theprojectsomething / Timer.js
Created Mar 17, 2014
Timer - a simple JS timing implementation utilising requestAnimationFrame.
View Timer.js
/*
Timer
- utilises animation frames (with a fallback to setTimeout when using the polyfill, below)
- returns remaining (or running) time
- pass a callback [fn], with an optional duration [ms] and autotart [bool], to the constructor or 'init' method
eg. new Timer(foo, 1000) *or* (new Timer()).init(foo, 0, true)
- for uniform x-browser support combine with the requestAnimationFrame polyfill from Erik Möller, et. al.
[https://github.com/darius/requestAnimationFrame]
*/
@negue
negue / NinePatchGroup.js
Created Mar 1, 2014
Phaser NinePatchGroup
View NinePatchGroup.js
/**
* NinePatchGroup
*
* @author Negue
* @extends {Phaser.Group}
* @param game
* @constructor
*/
var NinePatchGroup = function (game, x, y, targetWidth, targetHeight, imageKey) {
Phaser.Group.call(this, game);
@bevacqua
bevacqua / gulp-npm-publish.js
Created Jan 18, 2014
Publish packages to `npm` using Gulp.
View gulp-npm-publish.js
var spawn = require('child_process').spawn;
gulp.task('npm', function (done) {
spawn('npm', ['publish'], { stdio: 'inherit' }).on('close', done);
});
You can’t perform that action at this time.