Skip to content

Instantly share code, notes, and snippets.

View creallfluharty's full-sized avatar

creallfluharty

  • Columbia, MO
View GitHub Profile
@horsepunchkid
horsepunchkid / psql_bash_completion.sh
Created June 5, 2019 20:46
Bash completion for psql services
_complete_psql() {
services=$(egrep -o '^\[.+\]' ~/.pg_service.conf | cut -f2 -d[ | cut -f1 -d] | sort)
if [[ $services ]]
then
COMPREPLY=( $( compgen -W "$services" -- ${COMP_WORDS[COMP_CWORD]}) )
else
echo
echo "(no services)"
echo -n "> ${COMP_WORDS} "
fi
@stryku
stryku / CMakeSL.md
Last active June 19, 2020 06:21
CMakeSL (CMake Scripting Language) - An attempt to introduce a new scripting language for CMake

CMakeSL (CMake Scripting Language) - An attempt to introduce a new scripting language for CMake

Agenda

  • Abstract
  • Video
  • Why
  • How
  • Current status
  • Future plans
  • How to
@oliveratgithub
oliveratgithub / emojis.json
Last active November 14, 2024 11:47
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z
@chipolux
chipolux / move_window.py
Created August 23, 2017 00:08
Moving X11 Window (python-xlib)
import Xlib.display
WINDOW_NAME = 'some window name'
d = Xlib.display.Display()
r = d.screen().root
x = 0
y = 100
width = r.get_geometry().width
@ssokolow
ssokolow / x11_watch_active_window.py
Last active September 4, 2024 21:19
python-xlib example which reacts to changing the active window
#!/usr/bin/env python
"""python-xlib example which reacts to changing the active window/title.
Requires:
- Python
- python-xlib
Tested with Python 2.x because my Kubuntu 14.04 doesn't come with python-xlib
for Python 3.x.
@awesomebytes
awesomebytes / ipython_to_file.md
Created March 16, 2016 10:38
Save iPython session to a python file as code

Save an iPython session commands/code to a file

You must use the magic method %save:

In [1]: %save?
Type:       Magic function
String Form:<bound method CodeMagics.save of <IPython.core.magics.code.CodeMagics object at 0x7fb5d25bb1d0>>
Namespace:  IPython internal
File: /usr/lib/python2.7/dist-packages/IPython/core/magics/code.py
@subfuzion
subfuzion / curl.md
Last active November 19, 2024 20:02
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.

@binarycrusader
binarycrusader / pysdl2_pyopengl_modern_opengl_example.py
Last active December 29, 2023 22:19
pysdl2 pyopengl "modern" opengl example
#!/usr/bin/python2.7
"""Quick hack of 'modern' OpenGL example using pysdl2 and pyopengl
Based on
pysdl2 OpenGL example
http://www.arcsynthesis.org/gltut/Basics/Tut02%20Vertex%20Attributes.html
http://schi.iteye.com/blog/1969710
"""
import sys
@hightemp
hightemp / gist:11196851
Last active February 18, 2024 12:08
Convert .vdi to .img
vboxmanage clonehd image.vdi image.img --format RAW
qemu-img convert -f vdi -O raw image.vdi image.img
vbox-img convert --srcfilename image.vdi --stdout --srcformat VDI --dstformat RAW image.img