Skip to content

Instantly share code, notes, and snippets.

xemoe /
Created December 11, 2020 07:09
Ubuntu 20.04 setup wireless usb alfa awus036ach
josevalim /
Created September 13, 2012 21:52
Sinatra like routes in Rails controllers

Sinatra like routes in Rails controllers

A proof of concept of having Sinatra like routes inside your controllers.

How to use

Since the router is gone, feel free to remove config/routes.rb. Then add the file below to lib/action_controller/inline_routes.rb inside your app.

jcreamer898 / gist:2413975
Created April 18, 2012 14:33
Addy Osmani's Recommended JavaScript Style Guides & Beautifiers

For developers interested in improving the code style consistency of the JavaScript they write, I'm happy to recommend the following style guides:

  1. Idiomatic.js (highly recommended, very comprehensive and includes contributions by +Rick Waldron , +Mathias Bynens and more)

  2. jQuery Core Style Guide (used by jQuery core, QUnit and many other projects)

  3. Google JavaScript Style Guide - with some further comments

  4. Dojo Style Guide (another very comprehensive alternative)

henry0312 /
Created November 27, 2011 06:17
Build GCC on Mac OS X Lion
# 初期設定
export PATH="$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
# ソースコードのダウンロード
if [ ! -d $WORK/src ] ; then
mkdir src
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
<li><a href="">Remote Link (Google)</a></li>
BenWard / pinboard-full.js
Created January 29, 2011 07:47
A smarter bookmarklet for; wraps selected text in <blockquote> tags, keeps variables out of the global scope, supports filling tags from rel="tag" markup in the page, and titles from hAtom entry titles.
(function() {
// Change `silent` to true to invoke the promptless, self-closing
// version of the bookmarklet.
var silent = false;
var url = location.href;
var title = document.title;
// Look for a single hAtom entry on the page, and iff one is found, extract
// the entry-title in place of the document title: