Skip to content

Instantly share code, notes, and snippets.

@michitux
michitux / goQR.js
Created July 26, 2010 18:32
Bookmarklet for quickly creating QR-codes from URLs using QR-Server
/* This bookmarklet tries to find the first selected link and opens the QR code. When no link is selected the current URL is used. */
javascript:(function(){%20function%20openqr(url){window.open('http://api.qrserver.com/v1/create-qr-code/?data='+encodeURIComponent(url)+'&size=700x700&qzone=6');}%20var%20selected,dl,i;%20dl%20=%20document.links;%20if%20(window.getSelection%20&&%20window.getSelection().containsNode)%20{%20/*%20mozilla%20*/%20for(i=0;%20i<dl.length;%20++i)%20{%20if%20(window.getSelection().containsNode(dl[i],%20true))%20{%20selected%20=%20true;%20openqr(dl[i].href);%20break;%20}%20}%20}%20if%20(!selected)%20{%20/*ie,%20or%20mozilla%20with%20no%20links%20selected%20*/%20openqr(document.URL);%20}%20})();
/* This bookmarklet uses the current URL. On some pages the above bookmarklet doesn't work/always uses an unwanted URL. If you experience this issue or don't need selected links try this one. */
javascript:(function(){window.open('http://api.qrserver.com/v1/create-qr-code/?data='+encodeURICompo
@darcyparker
darcyparker / vimModeStateDiagram.svg
Last active July 4, 2024 12:03
Vim Modes Transition Diagram in SVG https://rawgithub.com/darcyparker/1886716/raw/eab57dfe784f016085251771d65a75a471ca22d4/vimModeStateDiagram.svg Note, most of the nodes in this graph have clickable hyperlinks to documentation.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 27, 2024 16:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@afair
afair / tmux.cheat
Last active June 3, 2024 23:26
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New new -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mrLexx
mrLexx / Vagrantfile
Last active March 8, 2017 16:03
PuPHPet Integration with hostsupdater
Vagrant.configure("2") do |config|
## Begin vagrant-hostsupdater
## https://github.com/cogitatio/vagrant-hostsupdater
## vagrant plugin install vagrant-hostsupdater
if Vagrant.has_plugin?("vagrant-hostsupdater") && configValues['apache']['install'] == '1'
config.hostsupdater.remove_on_suspend = true
config.hostsupdater.aliases = Array.new
configValues['apache']['vhosts'].each do |i, host|
@markerikson
markerikson / nodeenvDiscussion.md
Last active January 9, 2023 15:24
Summary of process.env.NODE_ENV and its use with Webpack

[02:06 PM] acemarke: @Steven : a couple other thoughts on the whole NODE_ENV thing. First, per my comments, it really is a Node concept. It's a system environment variable that Node exposes to your application, and apparently the Express web server library popularized using its value to determine whether to do optimizations or not
[02:08 PM] acemarke: Second, because of its use within the Node ecosystem, web-focused libraries also started using it to determine whether to they were being run in a "development" environment vs a "production" environment, with corresponding optimizations. For example, React uses that as the equivalent of a C #ifdef to act as conditional checking for debug logging and perf tracking. If process.env.NODE_ENV is set to "production", all those if clauses will evaluate to false.
Third, in conjunction with a tool like UglifyJS that does minification and removal of dead code blocks, a clause that is surrounded with if(process.env.NODE_ENV !== "development")

@dwilkie
dwilkie / docker-cheat-sheat.md
Last active May 12, 2024 14:08
Docker Cheat Sheet

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

@zmwangx
zmwangx / cross-repo-embedded-code-snippets.md
Last active February 28, 2023 18:48
GitHub feature request: cross-repo embedded code snippets

Hi,

I really like the embedded code snippets feature introduced last month,[1] but I just realized it doesn't work across repositories. Take this comment[2] as an example: currently, a snippet permalink into Linuxbrew/homebrew-core[3] is turned into an embedded snippet, but a snippet permalink into Linuxbrew/brew[4] is not. It would be really nice if cross-repo links are also converted. It would be beneficial to the Homebrew project for instance, where the package manager itself is developed in Homebrew/brew, the package definitions are developed in separate repos (what we call taps) like Homebrew/homebrew-core, and there are quite a bit of cross references between brew and taps. Thank you.

Best, Zhiming

[1] https://github.com/blog/2415-introducing-embedded-code-snippets
[2] https://github.com/Linuxbrew/homebrew-core/issues/4198#issuecomment-331113613
[3] https://github.com/Linuxbrew/homebrew-core/blob/59b343a86689531bc59702e376654821f766b1c8/Formula/glibc.rb#L16-L31