Skip to content

Instantly share code, notes, and snippets.

# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
<html>
<head>
<script type="text/javascript" src="LAB.js"></script>
<script type="text/javascript">
var _queue = ["script1.js",null], $L = $LAB;
</script>
...
</head>
<body>
@getify
getify / queue.LAB.js
Created November 17, 2010 22:20
adding "queueing" to LABjs dynamically, to be able to simulate the $LAB chain dynamically with a for-loop
<!DOCTYPE html>
<html>
<head>
<title>LABjs Demo</title>
<script src="/js/queue.LAB.js"></script>
<script>
// adding `false` in the queue will signifiy an empty .wait() in the $LAB chain
$LAB.queue("http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js", false);
$LAB.queue("http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js", false);
@scottjehl
scottjehl / jqm-simple-dynamic-page.js
Created June 21, 2011 14:08
jQuery Mobile: Simple dynamic page creation
/* Dynamically create a page and navigate to it.
(and include the page in browser history ) */
//create markup
var newPage = $("<div data-role=page data-url=yay><div data-role=header><h1>YAY!!!!</h1></div><div data-role=content><img src=http://bukk.it/yay.gif /></div></div");
//append it to the page container
newPage.appendTo( $.mobile.pageContainer );
//go to it
namespace.views.MyWizard = Backbone.Views.extend({
initialize: function() {
_.bindAll(this, 'render', 'wizardMethod');
}
render: function() {
this.wizardMethod();
return this;
},
@canton7
canton7 / 0main.md
Last active November 7, 2023 08:16
Local versions of tracked config files

How to have local versions of tracked config files in git

This is a fairly common question, and there isn't a One True Answer.

These are the most common techniques:

If you can modify your application

@rajraj
rajraj / es.sh
Created January 3, 2012 20:07 — forked from aaronshaf/es.sh
Install ElasticSearch on CentOS 6
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@btoone
btoone / curl.md
Last active June 29, 2024 16:01
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@nigelheap
nigelheap / problem_solver.info
Created May 23, 2012 04:50
problem_solver module
name = Problem solver
description = The module that will solve all your drupal problems
package = Problems
version = 1.x
core = 7.x