Skip to content

Instantly share code, notes, and snippets.

View DomenicoColandrea86's full-sized avatar

Domenico Colandrea DomenicoColandrea86

View GitHub Profile
@DomenicoColandrea86
DomenicoColandrea86 / exampleHiResInclude.scss
Created July 9, 2013 19:24
SASS resolution media query mixin
section {
// only include 1x size image for 'non-retina' screens
@include if-max-resolution(1.49) {
background-image: url('img/section-anchor@1x.png');
}
// only include 2x size image for 'retina' screens
@include if-min-resolution(1.5) {
background-image: url('img/section-anchor@2x.png');
background-size: 10.5625rem 1.5625rem;
}
@DomenicoColandrea86
DomenicoColandrea86 / typekit-mixin.scss
Created March 13, 2014 16:04
Typekit Font Mixin for SCSS
Sass Mixin for typekit variation-specific font-family names
Typekit IE6-8 Support (http://help.typekit.com/customer/portal/articles/6855-Using-multiple-weights-and-styles)
$lucida-grande: "Lucida Grande", Tahoma, Verdana, Arial, sans-serif;
$georgia: Georgia, Cambria, "Times New Roman", Times, serif;
// Must include fallbacks for EACH typekit font — set them each as variables
//************************************************************************//
$typekit-fonts: "source-sans-pro", "ff-tisa-web-pro"; // index [1, 2]
/**
* Example of using an angular provider to build an api service.
* @author Jeremy Elbourn (jelbourn@google.com)
*/
/** Namespace for the application. */
var app = {};
/******************************************************************************/
(function() {
var $injector = angular.injector(['ng']);
$injector.invoke(function($http, $rootScope) {
// this works!
$rootScope.$apply(function() {
$http.get("/auth/csrf_token").then(function(response) {
angular.module("app").constant("CSRF_TOKEN", response.csrf_token);
angular.bootstrap(document, ['app']);
/*
AngularJS v1.1.4
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
*/
(function(M,V,s){'use strict';function gc(){var b=M.angular;M.angular=hc;return b}function o(b,a,c){var d;if(b)if(I(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==o)b.forEach(a,c);else if(!b||typeof b.length!=="number"?0:typeof b.hasOwnProperty!="function"&&typeof b.constructor!="function"||b instanceof P||ca&&b instanceof ca||Da.call(b)!=="[object Object]"||typeof b.callee==="function")for(d=0;d<b.length;d++)a.call(c,b[d],
d);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],d);return b}function rb(b){var a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(c);return a.sort()}function ic(b,a,c){for(var d=rb(b),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function sb(b){return function(a,c){b(c,a)}}function Ea(){for(var b=Z.length,a;b;){b--;a=Z[b].charCodeAt(0);if(a==57)return Z[b]="A",Z.join("");if(a==90)Z[b]="0";else return Z[b]=String.fromCharCod
<html>
<head>
<title>Checkbox</title>
<style>
input[type=checkbox] {
display:none;
}
input[type=checkbox] + label
{
@DomenicoColandrea86
DomenicoColandrea86 / css-transitionspseudos.js
Created June 18, 2014 16:41
Modernizr feature-detect for css transitions on pseudos elements
// transitions pseudos test.
// check if CSS3 transitions take effect on pseudo elements.
// https://github.com/Modernizr/Modernizr/issues/295
// This test is asynchronous. Watch out.
// without csstransitions this check makes no sense and
// without getComputedStyle we wont be able to get the style from a pseudo element
if (Modernizr.csstransitions && window.getComputedStyle) {
define([
'marionette',
'templates'
], function(Marionette, Templates) {
var app = new Marionette.Application({
root: '/',
templates: Templates
});
#!/usr/bin/env python
# saved to ~/bin/batcharge.py and from
# http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/#my-right-prompt-battery-capacity
#!/usr/bin/env python
# coding=UTF-8
import math, subprocess
p = subprocess.Popen(["ioreg", "-rc", "AppleSmartBattery"], stdout=subprocess.PIPE)
output = p.communicate()[0]