Skip to content

Instantly share code, notes, and snippets.

@xemoe
xemoe / ubuntu_2004_awus036ach.md
Created December 11, 2020 07:09
Ubuntu 20.04 setup wireless usb alfa awus036ach
@josevalim
josevalim / 0_README.md
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
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 https://github.com/rwldrn/idiomatic.js/ (highly recommended, very comprehensive and includes contributions by +Rick Waldron , +Mathias Bynens and more)

  2. jQuery Core Style Guide http://docs.jquery.com/JQuery_Core_Style_Guidelines (used by jQuery core, QUnit and many other projects)

  3. Google JavaScript Style Guide - http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml with some further comments http://blog.founddrama.net/2010/08/annotated-google-javascript-style-guide/

  4. Dojo Style Guide http://dojotoolkit.org/community/styleGuide (another very comprehensive alternative)

@henry0312
henry0312 / gcc.sh
Created November 27, 2011 06:17
Build GCC on Mac OS X Lion
#!/bin/sh
# 初期設定
WORK=$HOME/Builds/GCC
PREFIX=$HOME/local
export PATH="$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
# ソースコードのダウンロード
if [ ! -d $WORK/src ] ; then
mkdir src
@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<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>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@BenWard
BenWard / pinboard-full.js
Created January 29, 2011 07:47
A smarter bookmarklet for Pinboard.in; 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: