Skip to content

Instantly share code, notes, and snippets.

View cowlicks's full-sized avatar
💭
SEE TRANSLATION

cowlicks

💭
SEE TRANSLATION
View GitHub Profile
@cowlicks
cowlicks / console.log.vim
Last active August 28, 2017 18:09
Vim map to write `console.log();` and drop you in insert mode in the parentheses
:map ,cll iconsole.log();<Esc>==f(a
:imap ,cll console.log();<Esc>==f(a
@cowlicks
cowlicks / getconsole.js
Created May 23, 2017 20:02
Get restore `console.log` on pages where it has been removed (like twitter) by pulling it out of an iframe.
function setConsole() {
var iframe = document.createElement('iframe');
iframe.style.display = 'none';
document.body.appendChild(iframe);
console = iframe.contentWindow.console;
window.console = console;
}
@krisselden
krisselden / index.js
Created April 3, 2017 22:02
Chrome Code Coverage Automation
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");
@cowlicks
cowlicks / vim send to tmux pane
Last active September 23, 2019 19:19
vim + tmux command for getting a tight feedback loop
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
@bendavis78
bendavis78 / gist:827089ff8f2a8d8975ee
Last active May 29, 2022 17:01
Installing Arch Linux on Chromebook Pixel 2
@stuart-warren
stuart-warren / simple-gpg-enc.go
Last active October 11, 2023 01:21
golang gpg/openpgp encryption/decryption example
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"encoding/base64"
"io/ioutil"
"log"
"os"
)
@malclocke
malclocke / gist:943565
Created April 27, 2011 01:31 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
$ git branch -r --merged |
awk -F'/' '/^ *origin/{if(!match($0, /(>|master)/)){print $2}}' |
xargs git push origin --delete