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
:map ,cll iconsole.log();<Esc>==f(a | |
:imap ,cll console.log();<Esc>==f(a |
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
function setConsole() { | |
var iframe = document.createElement('iframe'); | |
iframe.style.display = 'none'; | |
document.body.appendChild(iframe); | |
console = iframe.contentWindow.console; | |
window.console = console; | |
} |
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 * as fs from "fs"; | |
import { createSession } from "chrome-debugging-client"; | |
createSession(async (session) => { | |
let browser = await session.spawnBrowser("canary"); | |
let api = await session.createAPIClient("localhost", browser.remoteDebuggingPort); | |
let tabs = await api.listTabs(); | |
let tab = tabs[0]; | |
let client = await session.openDebuggingProtocol(tab.webSocketDebuggerUrl); | |
await client.send("Profiler.enable"); |
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
TLDR; It saves the file in the current tmux pane, then runs `!!` the previous command in another tmux pane. | |
This enables a workflow like: | |
1. Edit code in pane #0 | |
2. Run some test command in pane #1 | |
3. Do more editing in pane #0 | |
4. Hit `,p` to re-run the command from 2. with the new edits | |
5. Repeat step 2. if you want to run a new test command. | |
# The command |
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
package main | |
import ( | |
"bytes" | |
"code.google.com/p/go.crypto/openpgp" | |
"encoding/base64" | |
"io/ioutil" | |
"log" | |
"os" | |
) |
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
$ git branch -r --merged | | |
awk -F'/' '/^ *origin/{if(!match($0, /(>|master)/)){print $2}}' | | |
xargs git push origin --delete |