Skip to content

Instantly share code, notes, and snippets.

View tomcardoso's full-sized avatar

Tom Cardoso tomcardoso

View GitHub Profile
@razwan
razwan / _baseline.scss
Created April 14, 2014 16:20
Aligning type to baseline the right way with SASS
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {
@milsyobtaf
milsyobtaf / jquery.playgif.js
Created January 31, 2014 17:25
Play Gif, by @jesse of SB Nation
/*!
* Play GIF
*
* by Jesse Young
*
* a jQuery plugin to play GIF animations on mouseover (or any other event).
*
* Examples:
* $('img[src$=".gif"]').playGIF(); // default is mouseover
* $('img[src$=".gif"]').playGIF({on:'click'}); // play animation on click
@mbostock
mbostock / .block
Last active January 9, 2025 00:59
Save SVG as PNG
license: gpl-3.0
@willurd
willurd / web-servers.md
Last active April 20, 2025 00:42
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@iwarner
iwarner / _navbar.html.haml
Last active July 6, 2018 21:29
Middleman - Bootstrap - Navigation example
-### NavBar Partial
-# Usage
-# = partial("#{pathPartials}/bootstrap/navbar")
-# Requires a /data/navigation.yaml file to be present
-# Check and warn if empty
- if data.navigation.blank?
- puts "Data not found"
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 1, 2025 01:48
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@brandonb927
brandonb927 / osx-for-hackers.sh
Last active April 19, 2025 05:22
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//