Skip to content

Instantly share code, notes, and snippets.

View tomelam's full-sized avatar
💭
Still alive!

Tom Elam tomelam

💭
Still alive!
View GitHub Profile
@tomelam
tomelam / LICENSE.txt
Created June 13, 2011 07:47 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tomelam
tomelam / makeTree.js
Created May 14, 2012 14:57
Calling Zen's recursive object creator
st = zen.createSubtree(["dijit.TitlePane",
{id:"testRendering",
title:"Toolbar (click to expand) - Zen Notebook",
style:{top:"30px",right:"30px"},closable:true,open:false},
[["CENTER", {},[]]]]);
@tomelam
tomelam / makeTree.js
Created May 14, 2012 17:10
Calling Zen's recursive object creator (possible next version)
st = zen.createSubtree([["dijit.TitlePane",
{
id:"testRendering",
title:"Toolbar (click to expand) - Zen Notebook",
style:{top:"30px",right:"30px"},
closable:true,
open:false
}
],
[[["CENTER", {}],
@tomelam
tomelam / access-clos-member.lisp
Created May 14, 2012 18:26
Example access of a CLOS slot (member)
(x point) ; access the x coordinate of a point
@tomelam
tomelam / tree1.lisp
Created June 12, 2012 07:21
Simple Lisp tree structure #1
;;;; In this Lisp tree, leaves are atoms and children with children are lists.
(a
(b
c
(d
(e f))
g
h))
@tomelam
tomelam / README.md
Created July 14, 2012 07:12
How to use your Google Custom Search Engine in Chrome's Omnibox

How to use your Google Custom Search Engine in Chrome's omnibox

  • If you don't know what Chrome's omnibox is, see Chrome support.

  • Go to www.google.com/cse and add a Custom Search Engine with all your favorite web sites for one topic of interest to you. Let's suppose the topic of interest is JavaScript.

  • Do a search on your Custom Search Engine and save the URL of the finished search.

  • In Google Chrome, go to 'Settings', then (under 'Search') 'Manage Search Engines...'.

@tomelam
tomelam / ruby-on-ales.markdown
Created October 6, 2012 06:46 — forked from davidcelis/ruby-on-ales.markdown
Overview of talks given at Ruby on Ales

Ruby on Ales

Outgrowing the Cloud (Mike Moore)

  • Requests hitting the same load balancer can't handle HTTP and HTTPS at the same time because of SSL issues
  • If you are trying to access an outside resource behind a firewall, you have to tell them every time you get a new webserver so they can whitelist the new IP
  • If you know the IPs of your web servers and database servers, you can have requests hit these directly and bypass the load balancers.
  • Could buy your own data center, but then you have to buy a load balancing router. Those are fucking expensive (tens or hundreds of thousands of dollars)
  • You will need a VPS/Unix Shell account on a remote machine sitting in a country with some sane laws.

  • from your local machine, do:

    $ ssh -D 1080 user@host

On your browser (or other applications), go to the network connection settings, select the option to use a proxy and leave everything blank except the SOCKS option, where you fill in hostname as localhost or 127.0.0.1 and port number as 1080 (or whatever you filled in above). That is all!

@tomelam
tomelam / gem_and_rvm.md
Last active August 29, 2015 13:56
Gem (aka Rubygems) and RVM Patterns

Gem (aka Rubygems) and RVM

Here are all the patterns a beginning Rails programmer needs to know about Gem and RVM. Once you have the few steps of the workflow memorised, they will be second nature to you.

The Absolutely Most-Basic Gem Commands

First we have to be able to confidently use gems. But it is safer never to install gems until RVM is set to use a gemset. These commands are listed before any RVM commands because they can be used without RVM -- but if you are going to do much Ruby work, you will be better off using these only after creating gemsets to hold the gems you install.

$ gem install foo
;; See https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html
(server-start)
;; See http://rinari.rubyforge.org/nXhtml_002dMode.html
;;; nxml (HTML ERB template support)
(load "~/.emacs.d/nxhtml/autostart.el")