Skip to content

Instantly share code, notes, and snippets.

View creallfluharty's full-sized avatar

Christian Reall-Fluharty creallfluharty

  • Columbia, MO
View GitHub Profile
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@masak
masak / explanation.md
Last active July 9, 2024 17:07
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@wzpan
wzpan / fibonacci.py
Last active December 5, 2022 23:17
Python - Fibonacci Iterator
class Fib:
def __init__(self, max):
self.max = max
def __iter__(self):
self.a = 0
self.b = 1
return self
def __next__(self):
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@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
@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
@subfuzion
subfuzion / curl.md
Last active July 18, 2024 17:12
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.

@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
@ssokolow
ssokolow / x11_watch_active_window.py
Last active February 6, 2024 22:50
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.
@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