Skip to content

Instantly share code, notes, and snippets.

@weiweihuanghuang
weiweihuanghuang / Set Transform Origin to Centre of Selection.py
Last active January 9, 2016 14:50
Set Transform Origin to Centre of Selection
#MenuTitle: Set Transform Origin to Centre of Selection
# -*- coding: utf-8 -*-
__doc__="""
Sets origin point for Rotate tool to the centre of the selection.
"""
import GlyphsApp
Font = Glyphs.font
Doc = Glyphs.currentDocument
selectedLayer = Font.selectedLayers[0]
@tttimur
tttimur / cdf
Last active June 7, 2019 20:08
copy cdf
cdf() {
cd "$(osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)')";
}
@jamesmusgrave
jamesmusgrave / _smart-underline.scss
Last active September 24, 2019 17:57
Smart Underline Sass Mixin
@mixin smart-underline($background: #fff, $text: #000, $selection: #ffc, $position: 86%){
a {
color: inherit;
text-decoration: none;
background: -webkit-linear-gradient($background, $background), -webkit-linear-gradient($background, $background), -webkit-linear-gradient($text, $text);
background-size: .05em 1px, .05em 1px, 1px 1px;
background-repeat: no-repeat, no-repeat, repeat-x;
text-shadow: 0.03em 0 $background, -0.03em 0 $background, 0 0.03em $background, 0 -0.03em $background, 0.06em 0 $background, -0.06em 0 $background, 0.09em 0 $background, -0.09em 0 $background, 0.12em 0 $background, -0.12em 0 $background, 0.15em 0 $background, -0.15em 0 $background;
background-position-y: $position,$position, $position;
background-position-x: 0%, 100%, 0%;
# Important that you set the path to the folder where your docker-compose.yml lives
#
# e.g. Documents/Git/workspace
DOCKER_COMPOSE_PATH=''
# ---------------DOCKER/DOCKER COMPOSE:-------------------
# Runs a docker command of your choice from anywhere.
#
# Usage: dc <command>
@mariusGundersen
mariusGundersen / demo.js
Created May 2, 2012 21:29
The usefulOrientation function takes the arguments from an DeviceOrientationEvent and returns the orientation of the interface relative to the world
/*
Demo showing how to use the usefulOrientation function.
*/
function onDeviceOrientationChange(e){
console.log("deviceOrientation", e.alpha, e.beta, e.gamma);
var orientation = usefulOrientation(e.alpha, e.beta, e.gamma);
console.log("usefulOrientatino", orientation.alpha, orientation.beta, orientation.gamma);
}
window.addEventListener("deviceorientation", onDeviceOrientationChange, false);
@killdash9
killdash9 / vulture-nethack-mac-build.sh
Last active February 17, 2023 08:12
Build vulture nethack from source on Mac OSX. Place this file in the base of the vulture nethack source code and run it.
# Step 1: Install the following 3rd party prerequisites, you can get these from macports:
#
# sudo port install libpng
# sudo port install libsdl_ttf
# sudo port install libsdl_mixer
#
# Step 2: Download and unzip Vulture Nethack source from http://www.darkarts.co.za/vulture-for-nethack
#
# Step 3: Place this file at the base of the unzipped vulture nethack source directory, and run it:
# sh vulture-nethack-mac-build.sh
@wkjagt
wkjagt / audio-book-reader.md
Last active April 12, 2024 14:18
How I built an audio book reader for my nearly blind grandfather

#How I built an audio book reader for my nearly blind grandfather

Tweet this - Follow me

Last year, when visiting my family back home in Holland, I also stopped by my grand-parents. My grand-father, now 93 years old, had always been a very active man. However, during the presceding couple of months, he'd gone almost completely blind and now spent his days sitting in a chair. Trying to think of something for him to do, I suggested he try out audio books. After finally convincing him -- he said audio books were for sad old people -- that listening to a well performed recording is actually a wonderful experience, I realized the problem of this idea.

####The problem with audio devices and the newly blind. After my first impulse to jump up and go buy him an

@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
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:

Git Cheat Sheet

Commands

Getting Started

git init

or