Skip to content

Instantly share code, notes, and snippets.

View sunny-g's full-sized avatar

Sunny Gonnabathula sunny-g

View GitHub Profile
@gabrielhpugliese
gabrielhpugliese / meteor_ytapi.js
Created September 7, 2013 21:17
Snippet for using Google Youtube APIs with Meteor rendering engine (not Meteor UI). Assume the template is called "channel". You only need to implement onPlayerReady of line 44. It uses jQuery.getScript();
Meteor.startup(function () {
Session.set('YTApiReady', false);
Session.set('channelRendered', false);
});
onYouTubeIframeAPIReady = function() {
Session.set('YTApiReady', true);
};
Template.channel.created = function () {
@justmoon
justmoon / watch.js
Created August 29, 2013 09:36
Watching for transactions with ripple-lib
var ripple = require('ripple-lib');
var remote = ripple.Remote.from_config({
// "trace" : true,
"websocket_ip" : "122.70.133.11",
"websocket_port" : 5006,
"websocket_ssl" : false
});
remote.connect();
@justmoon
justmoon / send.js
Created August 29, 2013 09:33
Sending a transaction with ripple-lib
var ripple = require('ripple-lib');
// Example destination and amount
// --------------------------------------------------
var destination = "rfbKLd1VLB3o6fpkhCJexckArjoMmBm2wG";
var amount = "1/CNY/rJL724ibxVFb9EKkTe2StQ4u6ViWAQm1Wc";
// --------------------------------------------------
@DavidBruant
DavidBruant / ScreenTreeNode.js
Created August 25, 2013 21:36
2D BSP in JavaScript
(function(global){
"use strict";
function constEnumPropValueDesc(v){
return {
value: v,
enumerable: true,
configurable: false,
writable: false
};
@cmather
cmather / async.js
Created July 20, 2013 23:14
Async call from within a Meteor server side method.
if (Meteor.isServer) {
var Fiber = Npm.require('fibers');
function async (cb) {
Meteor.setTimeout(function () {
cb(null, 'hello');
}, 3000);
}
Meteor.methods({
@dirkk0
dirkk0 / doit.sh
Created July 9, 2013 13:55
Install pump.io on Amazon EC2
sudo apt-get update
# get ec2 ip and hostname
curl http://169.254.169.254/latest/meta-data/public-ipv4 > public.ip
curl http://169.254.169.254/latest/meta-data/public-hostname > public.hostname
sudo apt-get install --yes build-essential curl git
#install latest node
sudo apt-get install --yes python-software-properties python g++ make
sudo add-apt-repository --yes ppa:chris-lea/node.js
sudo apt-get update
@arcanis
arcanis / configure.txt
Created June 29, 2013 00:28
LLVM emscripting
--enable-optimized
--disable-polly
--disable-clang-arcmt
--disable-clang-static-analyzer
--disable-clang-rewriter
--disable-assertions
--disable-debug-symbols
--disable-jit
--disable-docs
--disable-threads
@gavinandresen
gavinandresen / TwoFactorWallet.md
Last active September 2, 2023 13:18
Yubikey/Google Authenticator protected Bitcoin Wallets

Thumbnail sketch: Two-factor (Yubikey or Google Authenticator) protected wallets

Hardware:

Computer. Shared-secret authenticator (Yubikey/Google Authenticator/etc). Server (possibly shared with millions of other users).

Motivating use case setup:

User creates a split (2-of-2 multisig) wallet on the computer and server. Keys must be securely backed up to protect against loss. GUI to be determined, but there will be some type of "Use Authenticator" checkbox specified at setup.

@rxin
rxin / ramdisk.sh
Last active November 21, 2024 15:11
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
@0xjjpa
0xjjpa / chrome.md
Created December 9, 2012 04:37
Understanding Google Chrome Extensions

#Introduction

Developing Chrome Extensions is REALLY fun if you are a Front End engineer. If you, however, struggle with visualizing the architecture of an application, then developing a Chrome Extension is going to bite your butt multiple times due the amount of excessive components the extension works with. Here are some pointers in how to start, what problems I encounter and how to avoid them.

Note: I'm not covering chrome package apps, which although similar, work in a different way. I also won't cover the page options api neither the new brand event pages. What I explain covers most basic chrome applications and should be enough to get you started.

Table of Contents

  1. Understand the Chrome Architecture
  2. Understand the Tabs-Extension Relationship
  3. Picking the right interface for the job