Skip to content

Instantly share code, notes, and snippets.

@gre
gre / easing.js
Last active April 30, 2024 04:58
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@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);
@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:

@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

@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%;
@bobbygrace
bobbygrace / trello-css-guide.md
Last active April 22, 2024 10:15
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

Git Cheat Sheet

Commands

Getting Started

git init

or

@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
@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]