Skip to content

Instantly share code, notes, and snippets.

@christopheranderton
christopheranderton / opera-mac-internal-pages-and-more.md
Last active February 26, 2024 04:15
A list of internal (and external) pages and useful information for macOS/OS X users (and others) of the Chromium/Blink based version of the web browser Opera.

Opera Development Icon

@widnyana
widnyana / dump.sh
Created June 24, 2016 06:01
Dump Current Nginx Config
# Set pid of nginx master process here
pid=8192
# generate gdb commands from the process's memory mappings using awk
cat /proc/$pid/maps | awk '$6 !~ "^/" {split ($1,addrs,"-"); print "dump memory mem_" addrs[1] " 0x" addrs[1] " 0x" addrs[2] ;}END{print "quit"}' > gdb-commands
# use gdb with the -x option to dump these memory regions to mem_* files
gdb -p $pid -x gdb-commands
# look for some (any) nginx.conf text
@tylerneylon
tylerneylon / learn.lua
Last active April 2, 2024 15:09
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@jmoiron
jmoiron / autogobuild.sh
Created August 2, 2012 23:27
Run this script in your directory to auto build whenever you modify a golang file
#!/bin/bash
cur=`pwd`
inotifywait -mqr --timefmt '%d/%m/%y %H:%M' --format '%T %w %f' \
-e modify ./ | while read date time dir file; do
ext="${file##*.}"
if [[ "$ext" = "go" ]]; then
echo "$file changed @ $time $date, rebuilding..."
go build
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@vivien
vivien / fossil.bash_completion
Created June 5, 2012 01:39
A bash_completion file for Fossil SCM, as /etc/bash_completion.d/git works for Git, providing a __fossil_ps1 bash function, and other tools.
# Bash completion support for Fossil.
# It is based on the Git Bash completion file.
# It best fits in /etc/bash_completion.d/fossil
#
# Copyright (C) 2011 Vivien Didelot <vivien@didelot.org>
# This file is distributed under the same terms as the license of the Fossil project.
#
# This file contains routine to change your PS1, and helper functions.
#
# For instance, add those options to your bashrc to customize PS1:
@AndrewRadev
AndrewRadev / Coffeescript ctags
Created February 28, 2012 13:51 — forked from wereHamster/Coffeescript ctags
ctags definitions for coffeescript
# Detects classes, static/class methods, plain functions and variables.
# To use, place it in a ~/.ctags file.
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/(^|=[ \t])*class ([A-Za-z.]+)( extends [A-Za-z.]+)?$/\2/c,class/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?([A-Za-z.]+):.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?([A-Za-z.]+)[ \t]+=.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=[^->\n]*$/\1/v,variable/