Skip to content

Instantly share code, notes, and snippets.

@skratchdot
skratchdot / patatap.random.keys.js
Last active August 29, 2015 13:57
patatap.com random keys
/*
visit http://www.patatap.com/ then run this code in your
console. change the bpm and maxNotes variables
*/
(function (global) {
var bpm = 80,
maxNotes = 5,
interval = (60 * 1000) / bpm,
between = function (min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
@evan108108
evan108108 / jiraLabel.php
Last active August 29, 2015 14:03
JiraLabel
<?php
//to execute in bash
//php jiraLabel.php YOUR_SUBDOMAIN.atlassian.net YOUR_BASE64_ENCODED_(user:pass) "status%20in%20(Validated)%20AND%20project%20in%20(EMKI)" YOUR_LABEL
call_user_func(function($argv){
$jira = call_user_func_array(function($filename, $jira_uri, $jira_auth, $query_string, $label) {
return (object) array(
'uri' => $jira_uri,
'auth' => $jira_auth,
'jql' => $query_string,
'label' => $label,
@asvd
asvd / RPC for jailed JS.md
Last active August 29, 2015 14:05
Remote Procedure Call for the jailed JavaScript

Remote Procedure Call for the jailed JavaScript

UPD: just released a library implementing all the features described below: https://github.com/asvd/jailed

When there is a need to run an untrusted code in JavaScript, one may jail it within a web-worker. But what makes it secure, also makes it restricted. One may only send messages and transfer json-serialized

Vagrant::configure('2') do |config|
config.vm.define :box1, autostart: false do |box|
box.vm.box = 'raring'
box.vm.box_url = 'https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box'
box.vm.hostname = 'example.com'
box.vm.provider :aws do |aws, override|
aws.access_key_id = ENV['AWS_ACCESS_KEY_ID']
aws.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
aws.keypair_name = 'aws'
var net = require('net');
var sockets = [];
var port = 8000;
var guestId = 0;
var server = net.createServer(function(socket) {
// Increment
guestId++;
socket.nickname = "Guest" + guestId;
@zloidemon
zloidemon / gist:221df66ddc9e9c478b23
Last active August 29, 2015 14:17
Example FIFO queue in tarantool
> curl http://tarantool.org/dist/public.key |apt-key add -
> echo "deb http://tarantool.org/dist/master/ubuntu/ trusty main" > /etc/apt/sources.list.d/tarantool.list
> apt-get update
> apt-get install tarantool luarocks rlwrap
> mkdir ~/.luarocks
> echo "rocks_servers = {[[http://rocks.tarantool.org/]]}" >> ~/.luarocks/config.lua
> luarocks install queue
```lua
@icyleaf
icyleaf / kohana-3-rest-server-sample.php
Created April 23, 2010 07:40
RESTful by Kohana v3.0.x + Sprig
<?php defined('SYSPATH') or die('No direct script access.');
/**
* People API - Example Code
*
* @author icyleaf <icyleaf.cn@gmail.com>
* @link http://icyleaf.com
* @version 0.1
*/
class Controller_API_People extends Controller_REST {
@millermedeiros
millermedeiros / gist:712798
Created November 23, 2010 23:50
Simple string template parsing - AS3
/**
* Simple string replacement inspired by Mustache
* @param template String to be parsed
* @param data Object containing Key -> Value pairs.
* @return Formated string
*/
function parseTemplate(template : String, data : Object): String {
function replaceFn() : String{
var prop : String = arguments[1];
return (prop in data)? data[prop] : '';
/*
* Copyright (c) 2005, The haXe Project Contributors
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@squeedee
squeedee / AbstractSequencer.as
Created January 17, 2011 18:51
Robotlegs Sequencer Actor
package com.visfleet.robotlegs.bootstrap {
import org.robotlegs.core.ICommandMap;
import org.robotlegs.core.IReflector;
import org.robotlegs.mvcs.Actor;
public class AbstractSequencer extends Actor {
private var steps:Array = new Array();
[Inject]
public var reflector:IReflector;