Skip to content

Instantly share code, notes, and snippets.

View vladikoff's full-sized avatar
🚀
🧇

Vlad Filippov vladikoff

🚀
🧇
View GitHub Profile
@miketaylr
miketaylr / package.sh
Created October 29, 2010 18:14
Handy script for developing Opera extensions
#!/bin/bash
# zip up all the files in the current directory
if [ $1 ]; then
echo "Creating $1.oex"
zip -r $1.zip .
# rename the .zip file to an .oex file
mv $1.zip $1.oex
@jnx
jnx / rbenv-install-system-wide.sh
Created October 1, 2011 20:09
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
@4poc
4poc / LimitStream.js
Created December 10, 2011 03:41
Node.js: LimitStream (Bandwidth limited Readable+Writable Stream)
var fs = require('fs'),
util = require('util'),
Stream = require('stream').Stream;
/**
* Create a bandwidth limited stream
*
* This is a read+writeable stream that can limit how fast it
* is written onto by emitting pause and resume events to
* maintain a specified bandwidth limit, that limit can
@kazupon
kazupon / base.jade
Created March 9, 2012 17:20
jade template inheritance
!!! 5
html
head
h1 My Site
block scripts
script(src="/jquery.js")
body
block header
header
p some header content
@lvbreda
lvbreda / client.js
Created July 31, 2012 22:16
Hacky routing
if (Meteor.is_client) {
var Router = Backbone.Router.extend({
routes: {
"" : "main",
":page": "main" //this will be http://your_domain/
},
main: function(page) {
document.body.innerHTML = "";
page = page?page:"index";
var frag = Meteor.ui.render(function () {
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@cowboy
cowboy / child-test.js
Created August 22, 2012 16:19
Node.js: I can't seem to capture a child process's stdout and stderr in Windows.
var parent = function() {
var spawn = require('child_process').spawn;
var child = spawn(process.execPath, [process.argv[1], 123]);
var stdout = '';
var stderr = '';
child.stdout.on('data', function(buf) {
console.log('[STR] stdout "%s"', String(buf));
stdout += buf;
});
child.stderr.on('data', function(buf) {
@possibilities
possibilities / meteor-async.md
Created August 23, 2012 22:53
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:

@dariocravero
dariocravero / README.md
Created October 20, 2012 05:25
Save files in Meteor

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@deholic
deholic / meteor_twitter_auth.js
Created October 23, 2012 02:53
Prepare twitter oauth in Meteor 0.5.0
Meteor.startup(function() {
// check twitter authorize
var config = Accounts.loginServiceConfiguration.findOne({service: "twitter"});
if(!config) {
Accounts.loginServiceConfiguration.insert({
service: "twitter",
consumerKey: "YOUR_APP_CONSUMER_KEY",
secret: "YOUR_APP_CONSUMER_SECRET"
});
};