Skip to content

Instantly share code, notes, and snippets.

💭
😼

Lucas Garron lgarron

💭
😼
Block or report user

Report or block lgarron

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dabblet.css
html, body {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-family: Tahoma, sans-serif;
font-weight: bold;
}
.all {
@lgarron
lgarron / dabblet.css
Created Dec 7, 2016
hstspreload spinner
View dabblet.css
html, body {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.spinner {
width: 2em;
height: 2em;
border-radius: 1.25em;
@lgarron
lgarron / crbug-expand-blockers.js
Created Apr 11, 2016
crbug-expand-blockers.js
View crbug-expand-blockers.js
javascript:document.styleSheets[0].insertRule(".rel_issues a { white-space: normal !important;", 1);[].slice.call(document.querySelector(".rel_issues").querySelectorAll("a")).map(a => a.textContent += " %E2%80%93 " + a.title)
@lgarron
lgarron / console.log.cpp
Last active May 31, 2019
Trolling C++ using console.log
View console.log.cpp
/* Vararg code by Daniel Cheng (@zetafunction) */
#include <iostream>
#include <utility>
struct {
template<typename T>
static void log(T&& t) {
std::cout << t << "\n";
}
@lgarron
lgarron / copyToClipboard.html
Last active Aug 30, 2019
Simple `navigator.clipboard.writeText()` polyfill.
View copyToClipboard.html
<script>
// A minimal polyfill for `navigator.clipboard.writeText()` that works most of the time in most modern browsers.
// Note that:
// - In Edge, this may call `resolve()` even if copying failed.
// - In Safari, this may fail if there is nothing selected on the page.
// See https://github.com/lgarron/clipboard-polyfill for a more robust solution.
// License: public domain
function writeText(str) {
return new Promise(function(resolve, reject) {
var success = false;
@lgarron
lgarron / gist:aa2b0220a90e1b46aa4a
Last active Aug 29, 2015
Google Groups Markdown Link Generator
View gist:aa2b0220a90e1b46aa4a
/*
Convert to a bookmarklet using: http://chriszarate.github.io/bookmarkleter/
*/
prompt("Link", "[" + document.getElementById("t-t").innerHTML + "](" + location.href.replace("?utm_medium=email&utm_source=footer", "") + ")")
@lgarron
lgarron / captive-portal-testing.md
Last active Aug 29, 2015
Chrome Captive Portal Testing
View captive-portal-testing.md

Add the following line to /etc/hosts (remember to undo this):

127.0.0.1 www.gstatic.com

Run a simple server on port 80. Here's a command you can run from bash:

cat <<EOF | sudo python -
import SocketServer
import SimpleHTTPServer
class CustomHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@lgarron
lgarron / crbug-bookmarklet.js
Last active Jul 6, 2017
Copy a pretty URL version of a Chromium issue (e.g. https://crbug.com/414843).
View crbug-bookmarklet.js
/*
Convert to a bookmarklet using: https://chriszarate.github.io/bookmarkleter/
When you're on a Chromium issue page, this bookmarklet copies the short URL to clipboard. Also offers a markup version, a snippets version, and the pure ID.
Example: https://crbug.com/445359 instead of https://bugs.chromium.org/p/chromium/issues/detail?id=445359&can=1&q=owner%3Ame%20OR%20reporter%3Ame%20OR%20cc%3Ame%20OR%20commentby%3Ame&sort=-modified&colspec=ID%20Pri%20M%20Status%20Owner%20Summary%20OS%20Modified
*/
// https://github.com/lgarron/clipboard.js
var clipboard = {};
clipboard.copy = (function() {
View keybase.md

Keybase proof

I hereby claim:

  • I am lgarron on github.
  • I am lgarron (https://keybase.io/lgarron) on keybase.
  • I have a public key whose fingerprint is 7B61 7BC1 5F73 8A2A 3D90 13B1 E3EE C254 3880 CAE7

To claim this, I am signing this object:

View qs-clipboard-security.md

Clipboard Module Security (Writing to Disk)

Right now, the Clipboard Module for Quicksilver writes/caches clipboard data to disk in a few ways, e.g. here. Depending on your system, this data could grow to several megabytes and may be backed up unencrypted onto Time Machine or synced online via Dropbox. If you ever copy-and-paste complicate passwords or other sensitive data, you may consider this a significant security risk.

Hack to prevent Quicksiler from writing clipboard data to disk

  1. Set the following directories to read-only:

Directories:

You can’t perform that action at this time.