This file contains hidden or 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
atom.contextMenu.add | |
'atom-text-editor': [{ | |
type: 'separator' | |
},{ | |
label: 'fold all' | |
command: 'editor:fold-all' | |
},{ | |
label: 'unfold all' | |
command: 'editor:unfold-all' | |
},{ |
This file contains hidden or 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
<script> | |
window.addEventListener('storage',evt=>evt.key==='pingAll'&&console.log("got pinged")) | |
window.addEventListener('focus',()=>localStorage.setItem('pingAll',Date.now())||console.log("ping")) | |
</script> |
This file contains hidden or 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 | |
# | |
# automate switching between dark and light themes in fluxbox. it currently | |
# changes themes of fluxbox, gtk2/3, tint2, hexchat and liferea. | |
declare -A BRIGHTNESS=( [light]=100 [dark]=0 ) | |
# declare -A BRIGHTNESS=( [light]=4 [dark]=6 ) | |
declare -A VSCODE_THEME=( | |
[light]="Atom One Light" |
This file contains hidden or 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 | |
# descr: chainable "isRunning" functions | |
# Usage: R conky && echo "conky is running" || echo "conky is not running" | |
# S conky && echo "do something with $pid and $pcmd" || echo "do something else" | |
# simple isRunning function | |
R () { | |
pidof $1 > /dev/null | |
return $? | |
} |
This file contains hidden or 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 getOldNavDaily = oldNavUrl => fetch(oldNavUrl) | |
.then(resp => resp.json()) | |
.then(data => data.payload.nav); | |
getOldNavDaily('//example.com/getOldNavDaily.php').then(console.log); |
This file contains hidden or 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 shell = require('shelljs'); | |
const nexec = cmd => new Promise((resolve, reject) => { | |
shell.exec(cmd, (code, stdout, stderr) => { | |
if(stderr) reject(stderr); | |
if(code) reject(new Error('exit code')); | |
if(stdout) resolve(stdout); | |
reject(new Error('unexpected behaviour')); | |
}) | |
}); |
This file contains hidden or 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
{ | |
"configurations": [ | |
{ | |
"name": "Mac", | |
"includePath": [ | |
"/usr/include", | |
"/usr/local/include", | |
"${workspaceFolder}" | |
], | |
"defines": [], |
This file contains hidden or 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 | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
----- | |
$ time source ./nvm_loader1.sh |
This file contains hidden or 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
import React from 'react'; | |
import { themeChange } from '../../../style/theme'; | |
... | |
themeChange.subscribe(console.log); // logs dark/light |
This file contains hidden or 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
// ==UserScript== | |
// @name jsfiddle auto dark switch | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @include https://jsfiddle.net/* | |
// @grant none | |
// ==/UserScript== |
OlderNewer