⌘T | go to file |
⌘⌃P | go to project |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
⌃ ` | python console |
⌘⇧N | new window (useful for new project) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://cfenollosa.com/misc/tricks.txt | |
I have marked with a * those which I think are absolutely essential | |
Items for each section are sorted by oldest to newest. Come back soon for more! | |
BASH | |
* In bash, 'ctrl-r' searches your command history as you type | |
- Input from the commandline as if it were a file by replacing | |
'command < file.in' with 'command <<< "some input text"' | |
- '^' is a sed-like operator to replace chars from last command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# A simple script for remotely rebooting a Ubiquiti UniFi access point | |
# Version 1.0 (Dec 15, 2015) | |
# by Steve Jenkins (http://www.stevejenkins.com/) | |
# Requires sshpass (https://sourceforge.net/projects/sshpass/) which | |
# is probably available via dnf, yum, or apt on your *nix distro. | |
# USAGE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i intro.mov -vf "boxblur=5:1" intro-blur.mov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for filename in *.mp4; do base=${filename#mp4} echo "https://youdomain.com/${filename%.mp4}-900w.mp4"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://stackoverflow.com/questions/46145576/stack-multiple-images-in-semitransparent-layers-with-imagemagick | |
FRAMESDIR=frames | |
INPUTVIDEO=input.mp4 | |
curl https://cdn.joshwilliams.com/projects/2019/videostack/input.mp4 -o $INPUTVIDEO | |
mkdir -p $FRAMESDIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on pieces from this thread: | |
// http://stackoverflow.com/questions/1881716/merging-jquery-objects | |
// use: var currentRowEls = []; // array of various jQ ojbects | |
// $.mergeSelectors(currentRowEls).css({width:'200px'}); | |
(function($){ | |
$.mergeSelectors = function(objs) { | |
var ret = objs.shift(); | |
while (objs.length) { | |
ret = ret.add(objs.shift()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var shuffleAndValidateFiles = function(files) { | |
var F = new Array(); | |
while (files.length > 0) { | |
var N = Math.floor(Math.random()*files.length); | |
if ((files[N] instanceof File) && !files[N].hidden) { | |
F.push(files[N]); | |
} | |
files.splice(N,1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[].slice.call(document.querySelectorAll('#panel_content_4932_template li')).map(function(el){ return el.textContent.trim();}).filter(function(str){ return /^\S+x\S+$/.test(str) }).forEach(function(str){ var wh = str.split('x'); console.log(str, wh[1]/wh[0]) }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isAutoplaySupported = function (callback) { | |
var timeout; | |
var waitTime = 200; | |
var retries = 5; | |
var currentTry = 0; | |
var elem = document.createElement('video'); | |
var elemStyle = elem.style; | |
function testAutoplay(arg) { | |
currentTry++; |
NewerOlder