Skip to content

Instantly share code, notes, and snippets.


vagelim vagelim

View GitHub Profile
vagelim / PythonSimpleWebsocket
Created Jan 12, 2021 — forked from rich20bb/PythonSimpleWebsocket
Simple websocket server in Python. Echos back whatever is received. Works with Chome, Firefox 16, IE 10.
View PythonSimpleWebsocket
import time
import struct
import socket
import hashlib
import base64
import sys
from select import select
import re
import logging
from threading import Thread
vagelim / export_google_music.js
Created Aug 10, 2020 — forked from dcalacci/export_google_music.js
Export your Google Music Library and Playlists (Google Play Music All Access) (see for more)
View export_google_music.js
// Jeremie Miserez <>, 2015
// A little bit of Javascript to let you export your Google Music library, playlists, and album track lists :)
// I posted this as an answer here:
// 1. Go to: (or your playlist)
// 2. Open a developer console (F12 for Chrome). Paste
// code below into the console.
vagelim /
Created Jun 23, 2020 — forked from XVilka/
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
vagelim / Makefile
Created May 15, 2020 — forked from prwhite/Makefile
Add a help target to a Makefile that will allow all targets to be self documenting
View Makefile
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
View contactform.js
/** @jsx React.DOM */
var STATES = [
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS',
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR',
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'
var Example = React.createClass({

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

vagelim / gist:cdd54498537c60da31d1c0fa419963a3
Created Jun 18, 2019 — forked from tlrobinson/gist:1073865
Autocomplete Makefile targets. Add this to your shell config file.
View gist:cdd54498537c60da31d1c0fa419963a3
complete -W "\`grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' Makefile | sed 's/[^a-zA-Z0-9_-]*$//'\`" make
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
vagelim /
Last active May 22, 2017 — forked from miketheman/
Retrieve metadata about systems from Datadog
# Ensure you have `jq` installed -
$ brew install jq
/usr/local/Cellar/jq/1.4: 15 files, 748K, built in 9 seconds
# Grab your API_KEY and create an APPLICATION_KEY from
$ export API_KEY=aaabbbccc
$ export APPLICATION_KEY=111222333
$ curl -s "$DD_API&application_key=$DD_APP" \
vagelim /
Created Oct 31, 2016 — forked from pakt/
Direct read/write access to Python's memory
# read/write access to python's memory, using a custom bytearray.
# some code taken from:
# tested on:
# Python 2.7.10, ubuntu 32bit
# Python 2.7.8, win32
# example of correct output:
# inspecting int=0x41424344, at 0x0228f898