Skip to content

Instantly share code, notes, and snippets.

@paulirish
paulirish / open-chrome-tabs-in-safari.scpt
Created April 4, 2016 00:24
open chrome tabs in safari
tell application "Google Chrome"
set tab_list to every tab in the front window
repeat with the_tab in tab_list
set the_url to the URL of the_tab
tell application "Safari" to open location the_url
end repeat
end tell
<head>
...
<meta name="viewport" content="width=device-width">
...
</head>
@subfuzion
subfuzion / curl.md
Last active April 19, 2025 09:46
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@CMCDragonkai
CMCDragonkai / awk_key_to_values.sh
Last active August 21, 2018 07:23
AWK: Parsing Key to Value `key=value`
#!/usr/bin/env bash
# works in ZSH too
# returns VALUE1
awk --field-separator='=' '/KEY1/ { print $2; exit }' > >(read x; x=${x#\"}; x=${x%\"}; echo $x) <<EOF
KEY1="VALUE1"
KEY2=VALUE2
KEY1=VALUE3
EOF
@blha303
blha303 / newdomain.sh
Created February 16, 2016 17:43
Generate a CSR for a domain
#!/bin/bash
openssl rsa -in account.key -pubout 2>&1 | grep -v "writing"
echo "press enter..." >&2
read enter
openssl req -new -sha256 -key domain.key -subj "/" \
-reqexts SAN -config <(cat /etc/ssl/openssl.cnf \
<(printf "[SAN]\nsubjectAltName=DNS:$1"))
@esironal
esironal / codemirror-cdn.html
Last active November 3, 2024 09:40
Codemirror CDN
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Code Mirror CDN</title>
<link rel="stylesheet" href="http://esironal.github.io/cmtouch/lib/codemirror.css">
@esironal
esironal / github.jquery.js
Last active May 25, 2019 10:39 — forked from lsloan/ List GitHub Projects Using jQuery
list-github-projects-using-javascript
// http://aboutcode.net/2010/11/11/list-github-projects-using-javascript.html
jQuery.githubUserRepositories = function(username, callback) {
jQuery.getJSON("https://api.github.com/users/" + username + "/repos?callback=?", callback);
}
jQuery.fn.loadRepositores = function(username) {
this.html("<span>Querying GitHub for repositories...</span>");
var target = this;
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active April 17, 2025 18:20
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.