Skip to content

Instantly share code, notes, and snippets.

Taka Kojima gigafied

View GitHub Profile
View gh_key.sh
#!/bin/bash
RSA_FILE_PATH="~/.ssh/github_rsa"
RSA_FILE="${RSA_FILE_PATH/#\~/$HOME}"
CONFIG_FILE=~/.ssh/config
read -p 'Github RSA Key Email: ' emailvar
read -sp 'Github RSA Key Password: ' passvar
mkdir -p ~/.ssh
View gist:8bf259801f392eaf3cf057fafde626e9
process.on('uncaughtException', err => console.error('uncaughtException', err))
process.on('uncaughtRejection', err => process.emit('uncaughtException', err))
const example = () => {
return new Promise((resolve, reject) => {
setTimeout(() => reject(new Error('Uh oh')), 1000)
})
}
example()
@gigafied
gigafied / rtmp.js
Created Oct 29, 2015
UniFi Video - RTMP Streaming
View rtmp.js
(function () {
'use strict';
function initPlayer (url) {
jwplayer('playerID').setup({
file : url,
image: '//www.longtailvideo.com/content/images/jw-player/lWMJeVvV-876.jpg',
width: '50%',
primary: 'flash',
View gist:8251731
a {
transition-delay : n*100ms;
}
View gist:8047342
function hasNestedProperty(o, p) {
var i,
j;
for (i in o) {
j = o[i];
if (i === "p") {
return true;
}
View ember-animate.js
(function () {
Ember.View.reopen({
isPrepped : false,
isAnimating : false,
cancelAnimation : false,
currentAnimationClass : "",
View gist:7200024
location /muppets-most-wanted/mobile.html {
alias /path/to/files/mobile.html;
}
location /muppets-most-wanted/ {
alias /path/to/files/;
set $mobile_rewrite do_not_perform;
set $force_dt_cookie "";
View gist:4718601
define (
[
"rosy/base/Class",
"rosy/routing/Router",
"rosy/routing/HistoryRouter",
"rosy/routing/HashRouter",
"mySite/views/About"
],
View gist:4612577
define (
[
"rosy/base/Class",
"rosy/routing/Router",
"rosy/routing/HistoryRouter",
"rosy/routing/HashRouter",
"mySite/views/About"
],
@gigafied
gigafied / gist:4081536
Created Nov 15, 2012
Bookmarklet to Reload all <link rel="stylesheet"> tags on a given page. No moar CMD + SHIFT + R!!!
View gist:4081536
javascript:(function(){var links = document.getElementsByTagName("link");for (var i = 0; i < links.length; i++) {var link = links[i];if (link.rel === "stylesheet") {var queryString = "";var args = {};var href = link.href;href.replace(/[?&]+([^=&]+)(?:[=]*)([^&]*)/gi, function (m, key, value) {args[key] = value;});args.reload = (new Date()).getTime();for (var p in args) {queryString += (queryString ? "&" : "?") + p + "=" + args[p];}link.href = link.href.replace(/\?.*|$/, queryString);}}}());
You can’t perform that action at this time.