Skip to content

Instantly share code, notes, and snippets.

View fearphage's full-sized avatar
⌨️
Cache rules everything around me.

Phred Lane fearphage

⌨️
Cache rules everything around me.
View GitHub Profile
var redis = require('then-redis');
var db = redis.createClient('tcp://localhost:6379');
var express = require('express');
var app = express();
app.get('/heartbeat.php', function(req, res){ // lol not php!
db.sadd('heartbeats', req.query);
res.send('KTHXBAI');
});
// Use an AMD package here to gain access to nested internal modules.
require.config({
packages: [{
name: "jquery",
location: "vendor/jquery/src",
main: "index.js"
}]
});
// If we are using AMD, we don't care about core.
@fearphage
fearphage / diff_for_gist.user.js
Created November 6, 2009 10:06 — forked from os0x/diff_for_gist.user.js
Diff for gist.github for Opera
// ==UserScript==
// @name Diff for gists for Opera
// @include http://gist.github.com/*
// @include https://gist.github.com/*
// @ujs:modified 2010-09-10
// @ujs:download http://gist.github.com/raw/227881/53ad5dff46b825ea3facd77532b57da2ab445425/diff_for_gist.user.js
// ==/UserScript==
(function(window, $, rev) {
if (!$ || ((rev = $('#revisions li')).length < 2)) return;
@fearphage
fearphage / gist_logs.user.js
Created November 8, 2009 02:47 — forked from satyr/gist_logs.user.js
Shows commit logs on gist for Opera
// ==UserScript==
// @name gist logs
// @namespace http://d.hatena.ne.jp/murky-satyr
// @description Shows commit logs on Gist in Opera
// @include http://gist.github.com/*
// @include https://gist.github.com/*
// ==/UserScript==
(function($, reHref, reLines) {
$ && $('.id').each(function(i, me) {
// ==UserScript==
// @name Blogger Hatena Syntax
// @namespace http://d.hatena.ne.jp/edvakf/
// @description Hatena syntax and code highlight for blogger
// @include http://www.blogger.com/post-create.g*
// @include http://www.blogger.com/post-edit.g*
// ==/UserScript==
//
// Copyright (C) 2010 edvakf
//
// ==UserScript==
// @name Blogger Hatena Syntax
// @namespace http://d.hatena.ne.jp/edvakf/
// @description Hatena syntax and code highlight for blogger
// @include http://www.blogger.com/post-create.g*
// @include http://www.blogger.com/post-edit.g*
// ==/UserScript==
//
// Copyright (C) 2010 edvakf
//
<!DOCTYPE HTML>
<html>
<head>
<script src="sharedworker.multi-connect.renderer.js"></script>
</head>
<body>
<pre id="shared-worker-log"></pre>
</body>
</html>
// ==UserScript==
// @name searchalltabs.js
// @author edvakf (and thank you amachang for escapeXPathExpr)
// @namespace http://d.hatena.ne.jp/edvakf/
// @description An experimental UserJS to search for word from all tabs and move to the tab
// @license The MIT License
// @version 0.3
// @include *
// @released 2010-06-08
// @updated 2010-06-08
#!/usr/bin/env bash
# where do you want couchdb and its deps to be installed
COUCHDB_PREFIX="/opt/couchdb-1.0.1"
# Let's determine the correct arcitecture and choose the installer
if [ "`uname -m`" = "x86_64" ]; then
echo "Using 64-bit installer"
COUCHDB_INSTALLER_DOC_ID="26f246a0fe23d6a53d5326713308f43c"
COUCHDB_INSTALLER_BIN="install-couchdb-1.0.1_rel1-linux-x64.bin"

###Object.preventExtensions

  • Make object non-extensible (can't add properties)

###Object.seal

  • Make object non-extensible (can't add properties)
  • Make object's own properties non-configurable (can't remove them, or change their nature and/or attributes)

###Object.freeze

  • Make object non-extensible (can't add properties)
  • Make object's own properties non-configurable (can't remove them, or change their nature and/or attributes)