Skip to content

Instantly share code, notes, and snippets.

View dmamills's full-sized avatar
💭
ya yr smart but you'll never b dolphin smart

dmamills

💭
ya yr smart but you'll never b dolphin smart
View GitHub Profile
@dmamills
dmamills / ScreenshotDetector.swift
Created April 7, 2017 13:12 — forked from ts95/ScreenshotDetector.swift
OS X detect new screenshot event with Swift
import Foundation
typealias NewFileCallback = (fileURL: NSURL) -> Void
class ScreenshotDetector: NSObject, NSMetadataQueryDelegate {
let query = NSMetadataQuery()
var newFileCallback: NewFileCallback?
//Original
const makeRequest = () => {
return getJSON()
.then(data => {
if (data.needsAnotherRequest) {
return makeAnotherRequest(data)
.then(moreData => {
console.log(moreData)
return moreData
})
const makeRequest = () => {
return getJSON()
.then(data => {
if (data.needsAnotherRequest) {
return makeAnotherRequest(data)
.then(moreData => {
console.log(moreData)
return moreData
})
} else {
@dmamills
dmamills / mov2gif
Last active August 29, 2015 14:17 — forked from artursapek/mov2gif
#!/bin/bash
# mov2giv in out width
# mov2gif video_file_in.mov gif_file_out.gif 300
tmp_dir=/tmp/frames_$(date +%s)
mkdir $tmp_dir
if [ -z "$3" ]
then
size=600

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname