Skip to content

Instantly share code, notes, and snippets.

View jacine's full-sized avatar
😁

Jacine Luisi jacine

😁
View GitHub Profile
@dvessel
dvessel / css-stats-ack.sh
Created September 28, 2012 18:09 — forked from pjkix/css-stats-ack.sh
shell script to generate some css file statistics
#!/bin/bash
## v1.0.6
## this script will gernerate css stats
### example output
# CSS STATS
# ----------
# Floats: 132
@davereid
davereid / gist:3382971
Created August 17, 2012 21:43
Changing layout of panel on the fly
/**
* Implements hook_panels_pre_render().
*/
function custom_panels_pre_render($display, $renderer) {
// To switch a panel's layout on the fly, you need to not only set
// the display's layout, but also swap out the layout plugin in the
// renderer object.
ctools_include('plugins', 'panels');
if ($plugin = panels_get_layout($layout)) {
$display->layout = $layout;
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@dfadler
dfadler / get-sprite.sass
Created July 13, 2012 15:05
A SASS mixin for generating a sprite declaration block that will work with media queries
// http://compass-style.org/reference/compass/helpers/sprites/
@mixin get-sprite($map, $sprite, $repeat: no-repeat, $height: true, $width: true)
//http://compass-style.org/reference/compass/helpers/sprites/#sprite-file
$sprite-image: sprite-file($map, $sprite)
// http://compass-style.org/reference/compass/helpers/sprites/#sprite-url
$sprite-map: sprite-url($map)
// http://compass-style.org/reference/compass/helpers/sprites/#sprite-position
@arieh
arieh / Outliner.js
Created April 23, 2012 12:41
Cross-Lib accessible outline removal
/*!
Copyright (c) <2012> <Arieh Glazer>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@chx
chx / test.php
Created March 26, 2012 22:56
drupal_render - twig integration
<?php
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/Twig/lib/Twig/Autoloader.php';
Twig_Autoloader::register();
// Almost empty class, just swaps Twig_Node_Print objects to Drupal_Twig_Node_Print objects.
class Drupal_Twig_NodeVisitor implements Twig_NodeVisitorInterface {
function enterNode(Twig_NodeInterface $node, Twig_Environment $env) {
@nimbupani
nimbupani / color-overlay.scss
Created February 18, 2012 05:02
Sass Snippets
// Use @include colorize('image.png', red, 0.5)
@mixin colorize($image, $color, $opacity) {
background: $color;
$color: transparentize($color, 1 - $opacity);
background: -webkit-linear-gradient(left, $color, $color), url($image);
background: -moz-linear-gradient(left, $color, $color), url($image);
background: -ms-linear-gradient(left, $color, $color), url($image);
background: -o-linear-gradient(left, $color, $color), url($image);
}
@dvessel
dvessel / README.mdown
Last active December 10, 2024 11:34
Sass+Compass, Guard, LiveReload

This will enable Sass+Compass with LiveReload through Guard. (Guard screen cast)

You will also need a browser component to communicate with LiveReload. (browser extension, livereload.js)

If you prefer going through a GUI, that option is available. The following instructions is specific to Mac OS X and it works through the command line.

Note that this is not specific to Rails projects. This can work for any standalone front-end project.

Instructions

@JeffreyWay
JeffreyWay / gist:1525217
Created December 27, 2011 21:29
Instant Server for Current Directory
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
@mirisuzanne
mirisuzanne / pushpull.sass
Created December 14, 2011 20:42
push and pull for susy
@function move($n,$context:false)
$move: columns($n,$context) + gutter($context)
@return $move
=push($n,$c:false)
$sg: side-gutter()
@if $c
$sg: 0
margin-left: $sg + move($n,$c)