Skip to content

Instantly share code, notes, and snippets.

@paulogaspar7
paulogaspar7 / data-markdown.user.js
Created February 6, 2012 02:17 — forked from paulirish/data-markdown.user.js
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@paulogaspar7
paulogaspar7 / h5bp-twitter-bootstrap
Created February 6, 2012 02:19 — forked from paulirish/h5bp-twitter-bootstrap
h5bp + twitter bootstrap integration
#!/bin/sh
echo "
Cool, let's start.
"
src=$PWD
@paulogaspar7
paulogaspar7 / README.md
Created February 6, 2012 02:24 — forked from mbostock/.block
Focus + Context (via Brushing)

This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom.

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@paulogaspar7
paulogaspar7 / bootstrap-plugins.txt
Created February 7, 2012 17:04 — forked from mklabs/bootstrap-plugins.txt
h5bp + twitter bootstrap integration
bootstrap-tooltip.js
bootstrap-popover.js
bootstrap-alert.js
bootstrap-button.js
bootstrap-carousel.js
bootstrap-collapse.js
bootstrap-dropdown.js
bootstrap-modal.js
bootstrap-scrollspy.js
bootstrap-tab.js
@paulogaspar7
paulogaspar7 / backbone_helper.coffee
Created February 7, 2012 20:05 — forked from mattmccray/backbone_helper.coffee
Use Backbone.js classes as native CoffeeScript classes
# Backbone CoffeeScript Helpers by M@ McCray.
# Source: http://gist.github.com/625893
#
# Use Backbone classes as native CoffeeScript classes:
#
# class TaskController extends Events
#
# class TaskView extends View
# tagName: 'li'
# @SRC: '<div class="icon">!</div><div class="name"><%= name %></div>'
@paulogaspar7
paulogaspar7 / gist:1764761
Created February 8, 2012 02:53 — forked from paulirish/gist:854293
jQuery unserialize Form plugin
// Unserialize (to) form plugin - by Christopher Thielen
// adapted and desuckified (a little) by Paul Irish
// takes a GET-serialized string, e.g. first=5&second=3&a=b and sets input tags (e.g. input name="first") to their values (e.g. 5)
(function($) {
$.fn.unserializeForm = function(values) {
@paulogaspar7
paulogaspar7 / Clock.java
Created February 12, 2012 21:00 — forked from chrisvest/Clock.java
Unit testable `System.currentTimeMillis()`.
package util;
import java.util.concurrent.locks.LockSupport;
/**
* The Clock improves upon {@link System#currentTimeMillis()} in that it can be
* stopped and manually ticked forward. This is useful for testability.
* @author chris vest
*/
public final class Clock {
@paulogaspar7
paulogaspar7 / less2stylus.coffee
Created February 21, 2012 16:22 — forked from NHQ/less2stylus.coffee
Convert LESS to Stylus for Twitter Bootstrap
# Quick hack of regular expressions to convert twitter bootstrap from LESS to Stylus
less2stylus = (string) ->
string = string
.replace(/^(\ *)(.+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets
.replace(/^(\ *)([^\ ]+)\ +\{\ *\n?\ *?/mg, "$1$2\n$1 ") # remove opening brackets
.replace(/\ *\{\ *\n*/g, "\n") # remove opening brackets again (some random cases I'm too lazy to think through)
.replace(/\ *\}\ *\n*/g, "\n") # remove closing brackets
.replace(/\;\ *?$/gm, "") # remove semicolons
.replace(/@(\w+):(\ *)\ /g, "\$$1$2 = ") # replace @variable: with $variable =
.replace(/\@/g, "\$")
@paulogaspar7
paulogaspar7 / templatejs.js
Created February 23, 2012 23:33 — forked from tbranyen/templatejs.js
templatejs.js
// TemplateJS v3.1.1 MIT/GPL2 @jon_neal
(function (global) {
function escapeJS (str) {
return str.replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r');
}
function TemplateWalk (instance, str) {
// check for the opening and closer strings
var indexOpener = str.indexOf(instance.chars.open);
var indexCloser = str.indexOf(instance.chars.close);