⌘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
#!/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
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
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++; |
You don't really need a framework or fancy cutting-edge JavaScript features to do two-way data binding. Let's start basic - first and foremost, you need a way to tell when data changes. Traditionally, this is done via an Observer pattern, but a full-blown implementation of that is a little clunky for nice, lightweight JavaScript. So, if native getters/setters are out, the only mechanism we have are accessors:
var n = 5;
function getN() { return n; }
function setN(newN) { n = newN; }
console.log(getN()); // 5
setN(10);
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 | |
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
# Inspired from https://gist.github.com/faleev/3435377 | |
# Remove any existing packages: | |
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
# Get the dependencies (Ubuntu Server or headless users): | |
sudo apt-get update |
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
umd(function(require, exports, module) { | |
//... | |
},'my-module');function umd(fn,n){ | |
if(typeof define=='function')return define(fn); // AMD | |
if(typeof module=='object')return fn(require,exports,module); // CommonJS | |
var m={exports:{}};window[n]=fn(function(n){return window[n];},m.exports,m)||m.exports; // window | |
} |
NewerOlder