Skip to content

Instantly share code, notes, and snippets.

View escapedcat's full-sized avatar

escapedcat escapedcat

View GitHub Profile
@darren131
darren131 / gist:3410875
Created August 21, 2012 02:30
resize sprites in Compass
@mixin resize-sprite($map, $sprite, $percent) {
$spritePath: sprite-path($map);
$spriteWidth: image-width($spritePath);
$spriteHeight: image-height($spritePath);
$width: image-width(sprite-file($map, $sprite));
$height: image-height(sprite-file($map, $sprite));
@include background-size(ceil($spriteWidth * ($percent/100)) ceil($spriteHeight * ($percent/100)));
width: ceil($width*($percent/100));
height: ceil($height*($percent/100));
@khepin
khepin / EasterEgg.js
Last active December 13, 2015 21:18
EasterEgg.js
function EasterEgg(egg, cb) {
this.egg = egg;
this.cb = cb;
this.start();
}
EasterEgg.prototype.start = function() {
var egg = this.egg;
var buffer = [];
var cb = this.cb;
@adamcbrewer
adamcbrewer / webkit-css-mask.css
Created June 25, 2013 16:04
CSS: overflow/border-radius mask bug-thingy
/*
* There's a bug in Chrome/Safari using overflow:hidden with border-radius. This mask fixes it.
* Solution: http://stackoverflow.com/questions/5736503/how-to-make-css3-rounded-corners-hide-overflow-in-chrome-opera/10296258#10296258
*/
.masked {
position: absolute;
border-radius: 10px;
overflow: hidden;
/* this fixes the overflow:hidden in Chrome */
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
@airtonix
airtonix / .profile
Last active March 10, 2023 18:25
dynamic npm .bin.
# Copy this into your `~/.profile`.
# This setup an incredibly ugly hack that recompiles your `PATH`
# everytime the prompt is printed.
# I need this to inject the nearest `node_modules/.bin` into my
# path to make it easy to use the binarys there.
# Your normal PATH exports here
export PATH=$HOME/bin:$PATH
ORIGINAL_PATH=$PATH
@sergejmueller
sergejmueller / ttf2woff2.md
Last active March 9, 2024 13:37
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@coryasilva
coryasilva / jSignature AngularJs Directive.js
Last active February 3, 2016 13:10
AngularJs Directive for jSignature
//https://github.com/brinley/jSignature
//<div data-j-signature="form.signature" data-pen-color="#ff00ff" data-line-color="#00ffff" data-readonly="readonly"></div>
app.directive('jSignature', ['$timeout',
function ($timeout) {
return {
restrict: 'EA',
scope: {
model: '=jSignature',
penColor: '@',
lineColor: '@',
@bastianallgeier
bastianallgeier / statify.php
Last active October 4, 2022 17:12
A first draft for a script, which converts a Kirby site into a static site. It's a rough first draft, so don't expect it to be perfect. Play with it, if you like it!
<?php
/**
* Instructions:
*
* 1. Put this into the document root of your Kirby site
* 2. Make sure to setup the base url for your site correctly
* 3. Run this script with `php statify.php` or open it in your browser
* 4. Upload all files and folders from static to your server
* 5. Test your site
@shanesmith
shanesmith / fix-xcodeproj.rb
Created August 14, 2014 15:54
Fix a Cordova-generated xcodproj not having any schemes defined
#!/usr/bin/env ruby
require 'xcodeproj'
path = ARGV.shift
xcproj = Xcodeproj::Project.open(path)
# Fix schemes not being defined
xcproj.recreate_user_schemes
@shaharhesse
shaharhesse / gist:dc7c75979dfc1dd11e55
Last active January 22, 2019 19:38
@extend Compass sprites in @media queries
/*
* A simple way to extend Compass sprite classes within media queries.
* Based on the knowledge gained here: http://www.sitepoint.com/cross-media-query-extend-sass/
* I admit it's nowhere near as clever, but it does work :)
*/
/*
* Set-up sprites for each media size
*/
@wenzhixin
wenzhixin / ubuntu14.04-command-line-install-android-sdk
Last active January 16, 2024 21:15
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages