Skip to content

Instantly share code, notes, and snippets.

View Couto's full-sized avatar
👽
Did you raid area 51?

Luís Couto Couto

👽
Did you raid area 51?
View GitHub Profile
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
@Couto
Couto / dabblet.css
Created January 27, 2012 01:43
Button with Arrow
/**
* Button with Arrow
*/
body {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
}
@Couto
Couto / walk.js
Created April 17, 2012 19:22
Walk along an array of asynchronous functions
/**
* walk
* small function to walk along an array of functions
* each function walked gets an extra argument
* that argument is a function that should be called
* to notify the walk function to step to the next function
* the arguments given at call time are passed to the next function
*
* @function
* @param {Array} fns Array of functions
@Couto
Couto / namespace.js
Created May 10, 2012 14:21
Small & Recursive Namespace function
function namespace (ns) {
var parts = ns.split('.'),
root = window || this;
return (function walk (obj) {
if (!root[obj]) { root[obj] = {}; }
root = root[obj];
if (parts.length) { walk(parts.shift()); }
return root;
}(parts.shift()));
@Couto
Couto / spacedust.tmTheme
Created June 27, 2012 13:47
Sublime Text 2 - Spacedust theme with SublimeLinter config
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Spacedust</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@Couto
Couto / dabblet.css
Created July 20, 2012 21:17
Simple CSS font-style
body {
background: #fafafa;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #444;
}
article {
width: 50em;
@Couto
Couto / Espresso Soda.tmTheme
Created July 29, 2012 16:05
Sublime Text 2 - Espresso Soda Theme (adapted to SublimeLinter and TrailingSpaces)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Espresso Soda</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@Couto
Couto / SublimeLinter.sublime-settings
Created July 29, 2012 16:23
SublimeLinter configuration
/*
SublimeLinter default settings
*/
{
/*
Sets the mode in which SublimeLinter runs:
true - Linting occurs in the background as you type (the default).
false - Linting only occurs when you initiate it.
"load-save" - Linting occurs only when a file is loaded and saved.
@Couto
Couto / Camaleon.sublime-settings
Created July 29, 2012 16:36
Camaleon configuration
{
"current": 0,
"camaleon":
[
[
"Soda Light.sublime-theme",
"Packages/Themes/Espresso Soda/Espresso Soda.tmTheme"
],
[
"Soda Light.sublime-theme",
@Couto
Couto / trailing_spaces.sublime-settings
Created July 29, 2012 16:40
TrailingSpace configuration
{
// Color is determined by scope
"trailing_spaces_highlight_color" : "trailing.space",
// Max file size to search
"trailing_spaces_file_max_size" : 1048576,
// By default plugin is enabled or disabled (true|false)
"trailing_spaces_enabled" : true,