Skip to content

Instantly share code, notes, and snippets.

View cggaurav's full-sized avatar
🏠
Working from home

Gaurav cggaurav

🏠
Working from home
View GitHub Profile
@cggaurav
cggaurav / change_display.sh
Created February 17, 2012 10:04
Change Display
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VGA1 1920x1080_60.00
xrandr --output VGA1 --mode 1920x1080_60.00
@cggaurav
cggaurav / index.html
Created March 21, 2012 15:07 — forked from mbostock/README.md
Interactive Tree (D3)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Node-Link Tree</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.25.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.25.0"></script>
<style type="text/css">
circle.node {
@grimen
grimen / .bowerrc
Last active December 19, 2015 10:39
HTML5/S3/Grunt/Make/Pow project setup.
{
"directory": "app/components"
}
@christianberg
christianberg / bootstrap.sh
Last active April 1, 2016 12:20
Script to install Docker on a Ubuntu 13.04 host
#/bin/bash
set -e
echo "=== Activating Firewall (only SSH allowed) ==="
ufw allow ssh
ufw --force enable
if [ ! -f /swapfile ]; then
echo "=== Activating swap ==="
fallocate -l 1G /swapfile
# Basic text search with relevancy for MongoDB.
# See http://blog.tty.nl/2010/02/08/simple-ranked-text-search-for-mongodb/
# Copythingie 2010 - Ward Bekker - ward@tty.nl
#create (or empty) a docs collection
doc_col = MongoMapper.connection.db('example_db').collection('docs')
doc_col.remove({})
#add some sample data
doc_col.insert({ "txt" => "it is what it is"})
@dfrankland
dfrankland / bootstrap-v4-alpha-responsive-text-align.css
Last active April 3, 2018 03:51
Responsive text-align classes for Bootstrap v4-alpha http://v4-alpha.getbootstrap.com/
/* Responsive Text Align */
/* Text Align Up */
@media (min-width: 34em) {
.text-center-sm-up {
text-align: center;
}
.text-right-sm-up {
text-align: right;
}
@technobly
technobly / SparkCoreWS2801.cpp
Last active April 29, 2018 21:57
SPARK CORE Adafruit_WS2801 LIBRARY & EXAMPLE
//-----------------------------------------------//
// SPARK CORE Adafruit_WS2801 LIBRARY & EXAMPLE //
//===============================================//
// Copy this into a new application at: //
// https://www.spark.io/build and go nuts! //
// Read comments in APPLICATION.CPP section for //
// Hookup details! //
//-----------------------------------------------//
// Technobly / BDub - Jan 9th, 2014 //
//===============================================//
@twolfson
twolfson / README.md
Last active December 2, 2018 07:05
Internal monitoring evaluation / research
@grimen
grimen / streams-test.js
Last active January 23, 2019 09:41
Experiments with Node.js Stream API.
/* =============================================
Dependencies
------------------------------------------ */
const debug = require('debug')
const chalk = require('chalk')
const { Readable, Writable, Transform, pipeline } = require('stream')
@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: