Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View smockle's full-sized avatar

Clay Miller smockle

View GitHub Profile
@smockle
smockle / gif.sh
Last active July 25, 2020 05:34
Convert .mov to .gif in OS X with ffmpeg & imagemagick
ffmpeg -i in.mov -vf scale=800:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -layers Optimize -loop 0 - out.gif
@smockle
smockle / osx.sh
Created August 24, 2015 17:18
Reset Finder, the Dock, the Open With menu and the clipboard in OS X.
#!/usr/bin/env bash
killall Finder
killall Dock
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
launchctl stop com.apple.pboard
launchctl start com.apple.pboard
class Container {
constructor(x) {
this.__value = x;
}
static of(x) {
return new Container(x);
}
map(f) {
@smockle
smockle / invision.js
Created July 7, 2015 18:21
Don’t let InVision mockups overflow viewport width
/*eslint-env browser */
/*eslint quotes: [1, "single"] */
(function() {
'use strict';
var selectors = [ '.viewport', 'div.screen', 'div.screen img' ];
selectors.forEach(function(selector) {
var element = document.querySelector(selector);
if (!(element instanceof HTMLElement)) { return; }
@smockle
smockle / twitter.js
Created May 26, 2015 04:54
Almost working Twitter OAuth API signing code for authentication.
sign(href, method) {
return co(function* () {
let token = yield this.token;
let consumerKey = encodeURIComponent(process.env.TWITTER_CONSUMER_KEY);
let consumerSecret = encodeURIComponent(process.env.TWITTER_CONSUMER_SECRET);
let accessToken = encodeURIComponent(process.env.TWITTER_ACCESS_TOKEN);
let nonce = btoa(Random.string(32));
let timestamp = new Date().getTime();
@smockle
smockle / video-export.md
Last active August 29, 2015 14:19
Settings I used to export a video file to three formats, for use in <video>
Progressive
H.264
Scan
@smockle
smockle / styles.less
Last active August 29, 2015 14:18
Atom Editor styles to differentiate keys and values in JSON files
// Style JSON keys and values differently
atom-text-editor::shadow .meta.structure.dictionary.json {
// Keys
& > .string.quoted.json,
.punctuation.definition.string.json {
color: @blue;
}
// Values
& > .value.json > .string.json,
@smockle
smockle / styles.less
Last active August 29, 2015 14:16
Atom Editor One Dark theme modifications for OS X.
// Hide icons in tabs
.tab-bar li.tab .title:before {
display: none;
}
// Left align close button and modified indicator in tabs
.tab-bar .tab.active .title,
.tab-bar .tab .title {
padding-left: 28px;
}
@smockle
smockle / init.coffee
Last active August 29, 2015 14:15
Close inactive tabs using Option-Command-w in Atom Editor
# Add the lines below to your init script,
# accessible via Atom > Open Your Init Script
atom.commands.add 'atom-workspace', 'tabs:force-close-other-tabs', ->
tabBar = atom.workspace.getPanes()[0]
tabBarElement = atom.views.getView(tabBar).querySelector(".tab-bar")
tabBarElement.querySelector(".active").classList.add("right-clicked")
atom.commands.dispatch(tabBarElement, 'tabs:close-other-tabs')
@smockle
smockle / conferences.md
Last active August 29, 2015 14:15
Interesting web, mobile, design, ux and accessibility conferences in 2015 (US only)

##O’Reilly Fluent Conference 2015 Dates: 20th-22nd April
Location: San Francisco, CA
Ticket Price: $1245
Twitter Attending: 6

Put JavaScript, HTML5, CSS, & the latest web tools to work. Fluent is for everyone who has a hand in web development, from front-end to back-end and everything in between. Get practical training on the latest in HTML5, CSS3, JavaScript, and the frameworks that build on those technologies.

- All Sessions (Tue-Wed) - All Keynotes (Tue-Wed) - 3-month subscription to Safari Pro - Exhibit Hall (Tue-Wed)