Skip to content

Instantly share code, notes, and snippets.

Avatar
👷‍♂️
Working from home

Jimmy Moon ragingwind

👷‍♂️
Working from home
View GitHub Profile
@ragingwind
ragingwind / launch.json
Created Apr 9, 2018
Debugging electron app with vscode
View launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Electron: Main",
"protocol": "inspector",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"runtimeArgs": [
@ragingwind
ragingwind / run.js
Last active Apr 9, 2018
running code block by wrapping module
View run.js
const m = require('module')
const res = vm.runInThisContext(m.wrap(code))(
exports,
require,
module,
__filename,
__dirname
)
@ragingwind
ragingwind / console.log.js
Created Mar 2, 2018
Logger with console.log and call stack in strict mode
View console.log.js
const log = console.log
console.log = function logIt() {
var stack = new Error().stack,
callee = stack.split('\n')[3].slice(7),
tag = '[LOG]';
if (arguments.length > 0) {
tag = Array.prototype.slice.call(arguments, 0)[0]
}
log.call(this, tag, callee)
arguments.length > 1 && log.apply(this, arguments)
View shell-i-used-at-least-once.sh
# find directories in the path
find . -maxdepth 10 -type d
@ragingwind
ragingwind / package.json
Created Jul 7, 2017
tiddlywiki package.json
View package.json
{
"name": "tiddlywiki",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"tiddlywiki": "^5.1.14"
},
"scripts": {
"build": "tiddlywiki wiki --init server",
View cvim.rc
let searchalias b = "bookmark"
let searchalias g = "google"
View header template for presentation of marp.html
<!-- $theme: default -->
<!-- prerender: false -->
<!-- page_number: false -->
<!-- $width: 1980px -->
<!-- $height: 1080px -->
<link href='https://fonts.googleapis.com/css?family=Roboto:100' rel='stylesheet' type='text/css'>
<style>
p {
View react-pwa-hello-world.firebaseapp.com_2017-04-21_17-43-38.json
{
"lighthouseVersion": "1.6.0",
"generatedTime": "2017-04-21T08:43:38.178Z",
"initialUrl": "https://react-pwa-hello-world.firebaseapp.com/#/",
"url": "https://react-pwa-hello-world.firebaseapp.com/#/",
"audits": {
"is-on-https": {
"score": true,
"displayValue": "",
"rawValue": true,
View chpwd.fish
function chpwd --on-variable PWD --description 'handler of changing $PWD'
if not status --is-command-substitution ; and status --is-interactive
set cur_cwd (echo $PWD | sed -e "s|^$HOME|~|" -e 's|^/private||')
# set_color -o black
# printf (printf "%*s" (tput cols)) | sed -e "s/ /\─/g";
echo ""
printf "%s⇢ %sEntering %s%s%s …\n" (set_color $fish_color_cwd) (set_color normal) (set_color $fish_color_cwd) $cur_cwd (set_color normal)
ls
View git-proxy.fish
function git-proxy --description "gite <command> <arguments>"
set cmd $argv[1]
set --erase argv[1]
eval "git-"$cmd $argv
end