Skip to content

Instantly share code, notes, and snippets.

View gnclmorais's full-sized avatar
🐙
Growing a beard

Gonçalo Morais gnclmorais

🐙
Growing a beard
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cross-browser kerning-pairs & ligatures</title>
<style>
body { font-family: sans-serif; background: #f4f3f3; color: rgba(40, 30, 0, 1); width: 500px; margin: 80px auto; padding: 0px; }
a { color: rgba(15, 10, 0, 0.8); text-decoration: none; border-bottom: 1px solid; padding: 1px 1px 0px; -webkit-transition: background 1s ease; }
a:hover { background: rgba(0, 220, 220, 0.2); }
p, li { line-height: 1.5; padding: 0em 1em 0em 0em; margin: 0em 0em 0.5em; }
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@140bytes
140bytes / LICENSE.txt
Created May 9, 2011 16:13
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
@bentruyman
bentruyman / Custom.css
Created August 17, 2011 00:30
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@heartcode
heartcode / scroll-window-to.js
Created February 11, 2012 23:23
Scrolls the window to the required position (Please note that this snippet works best with top scrolling just for now)
/*
* Scrolls the window to the required position using animation with custom easing.
* The required position can be set with the 1st argument ('position');
* The fineness of the animation can be customized by using the 'speed' (2nd) argument, which ranges between 0.1 (very fine) and 1 (instant jump).
* Usage #1:
* scrollWindowTo(0, 0.2); // -> Scrolls the page to the top with a fine animation
* Usage #2:
* scrollWindowTo(100, 1); // -> Makes the page jump to 100px
*/
var scrollWindowTo = (function(){
@adarsh
adarsh / anonymizer_source.rake
Created February 20, 2012 20:09
Code from blog post on anonymizing sensitive user data
task :env_checker do
unless Rails.env.development?
puts "Not in development environment, exiting!"
exit 1
end
end
namespace :app_name do
desc 'Anonymize user, company, and location information'
task :anonymize => [:environment, :env_checker] do
@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
@nijikokun
nijikokun / example-user.js
Created May 3, 2012 20:46
Beautiful Validation... Why have I never thought of this before?!
var user = {
validateCredentials: function (username, password) {
return (
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' }
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' }
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' }
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' }
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' }
: false
);