Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
subtleGradient / Brilliance Black (Inverted).tmTheme
Created January 3, 2010 22:52
Brilliance Black, My Little Pony (Brilliance White), Brilliance Dull TextMate Themes in the `tmTheme` format. By Thomas Aylott (SubtleGradient). These themes were designed so that logically similar things will have similar colors. These are extremely rich
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Thomas Aylott</string>
<key>comment</key>
<string>Thomas Aylott ㊷ subtleGradient.com</string>
<key>name</key>
<string>Brilliance Black (Inverted)</string>

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@finger-berlin
finger-berlin / beanstald.sh
Created February 29, 2012 16:35
OSX script for easy start & stop beanstalkd (brew version)
#!/bin/sh
daemon=beanstalkd
executable=/usr/local/bin/$daemon
port=11300
waldir=/usr/local/var/beanstalkd
logfile=/usr/local/var/log/beanstalkd.log
interface="127.0.0.1"
params="-l $interface -p $port -b $waldir"
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 5, 2024 13:30
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
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
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:

@StefanoRausch
StefanoRausch / Default (OSX).sublime-keymap
Created February 14, 2013 16:26
Sublime : 2 Columns Layout Management
[
{ "keys" : [ "alt+1" ], "command" : "focus_group", "args" : { "group" : 0 } },
{ "keys" : [ "alt+2" ], "command" : "focus_group", "args" : { "group" : 1 } },
{ // workspace left
"keys" : [ "ctrl+alt+super+left" ],
"command" : "run_multiple_commands",
"args" : {
@eusonlito
eusonlito / foldersize.php
Last active July 25, 2023 12:50
PHP function to get the folder size including subfolders
<?php
function folderSize ($dir)
{
$size = 0;
foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) {
$size += is_file($each) ? filesize($each) : folderSize($each);
}
@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 git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@hoandang
hoandang / get_rotate.js
Last active May 25, 2022 03:33
Javascript: get the angle by which the element is rotated
function getRotationAngle(target)
{
const obj = window.getComputedStyle(target, null);
const matrix = obj.getPropertyValue('-webkit-transform') ||
obj.getPropertyValue('-moz-transform') ||
obj.getPropertyValue('-ms-transform') ||
obj.getPropertyValue('-o-transform') ||
obj.getPropertyValue('transform');
let angle = 0;