Skip to content

Instantly share code, notes, and snippets.

@stubbetje
stubbetje / debug.unusedstylesheets.js
Created February 16, 2009 16:01
create list of unused stylesheet rules
// create list of unused stylesheet rules
$(document).ready(function()
{
var sel = [];
for( var s = 0 ; s < document.styleSheets.length ; s++ ) {
var rules = document.styleSheets[s].cssRules || document.styleSheets[s].rules;
for( var r = 0 ; r < rules.length ; r++ ) {
@chrisjacob
chrisjacob / README.md
Created February 18, 2011 03:44
Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

@garyharan
garyharan / _mixins.scss
Created May 5, 2011 15:46
Useful scss mixins (rounded corners, gradients, text-field, button)
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@fearphage
fearphage / README.md
Created September 20, 2012 14:45
Can you make this faster?

The goal is to add N new elements to the DOM as quickly and as painlessly as possible.

I have access to jQuery and found the code below to be faster than the following:

$(parentElement)
  .append(Array(1001).join(template))
;
@pmuellr
pmuellr / cid.js
Created October 5, 2012 23:05
Cordova iOS Developer tool
#!/usr/bin/env node
fs = require("fs")
path = require("path")
child_process = require("child_process")
//------------------------------------------------------------------------------
PROGRAM = path.basename(__filename)
VERSION = "0.2.0.2012-10-09"
@jareware
jareware / SCSS.md
Last active October 12, 2024 17:11
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@domenic
domenic / default-anon.md
Last active June 29, 2022 01:05
Default anonymous export = module instance object

Kevin's "default anonymous export" idea.

Let anon be the symbol denoting anonymous export.

Assume the following syntaxes:

export default [Expression]; // sets the anonymous export
export [Declaration] // sets a named export
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git
@gregrickaby
gregrickaby / html5-schema.org-markup.html
Last active August 2, 2022 00:05
Proper SCHEMA.ORG markup
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noodp, noydir" />
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com">
<link rel="canonical" href="http://mysite.com/" />
<link rel="stylesheet" href="http://mysite.com/style.css" type="text/css" />
@romaricpascal
romaricpascal / commit-msg.issue-id-prompt.js
Last active December 29, 2022 23:47
commit-msg Git hook to ask user for an issue ID when he commits and prepend it to the original commit message
#!/usr/bin/env node
var fs = require('fs'),
util = require('util');
// Rattern to format the message with the issue ID
var MESSAGE_FORMAT = '[%s] %s';
// Git commit messages are stored in a file, passed as argument to the script
// First and second arguments will be 'node' and the name of the script
var commitFile = process.argv[2];