Skip to content

Instantly share code, notes, and snippets.

View mudream4869's full-sized avatar
📚
Mukyu Learning

神楽坂帕琪 mudream4869

📚
Mukyu Learning
View GitHub Profile
@FSX
FSX / async_psycopg2.py
Created March 8, 2011 22:11
A module for asynchronous PostgreSQL queries in Tornado.
#!/usr/bin/env python
__author__ = 'Frank Smit <frank@61924.nl>'
__version__ = '0.1.0'
import functools
import psycopg2
from tornado.ioloop import IOLoop, PeriodicCallback
@tm8st
tm8st / SimpleRayTrace.hs
Created June 2, 2011 15:43
Simple ray tracer implement in haskell
-- Simple ray tracer implement in haskell.
-- Reference.
-- http://www.t-pot.com/program/92_RayTraceSphere/index.html
-- http://www.t-pot.com/program/94_RayTraceLighting/index.html
-- http://boegel.kejo.be/ELIS/Haskell/HRay/
module Main where
import Debug.Trace (trace)
import Data.List (foldl')
@developernotes
developernotes / gist:1146913
Created August 15, 2011 14:53
kill diskimages-helper processes
ps -A | grep diskimages-helper | awk '{print $1}' | xargs kill -9
@omangin
omangin / kinect.py
Created April 18, 2012 15:03
Module to connect to a kinect through ROS + OpenNI and access the skeleton postures.
# encoding: utf-8
"""Module to connect to a kinect through ROS + OpenNI and access
the skeleton postures.
"""
import roslib
roslib.load_manifest('ros_skeleton_recorder')
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 21, 2024 20:54
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@consindo
consindo / multithreaded_sqlite.py
Created September 30, 2012 08:14
Multithreaded SQLite Python
from threading import Thread
from Queue import Queue
import sqlite3
class MultiThreadOK(Thread):
def __init__(self, db):
super(MultiThreadOK, self).__init__()
self.db=db
self.reqs=Queue()
self.start()
@jedda
jedda / gist:4103604
Created November 18, 2012 04:44
Configuring basic RADIUS on OS X 10.8 Server
# Configuring basic RADIUS on OS X 10.8 Server
# Jedda Wignall
# http://jedda.me
# Full writeup at: http://jedda.me/2012/11/configuring-basic-radius-os-108-server/
# create the SACL for access to RADIUS
dseditgroup -q -o create -u <admin user> -n . com.apple.access_radius
# configure radiusd to log both successful and failed authentications
@evansneath
evansneath / Python3 Virtualenv Setup
Last active March 7, 2022 16:31
Setting up and using Python3 Virtualenv
To install virtualenv via pip
$ pip3 install virtualenv
Note that virtualenv installs to the python3 directory. For me it's:
$ /usr/local/share/python3/virtualenv
Create a virtualenvs directory to store all virtual environments
$ mkdir somewhere/virtualenvs
Make a new virtual environment with no packages
@drewolson
drewolson / reflection.go
Last active November 20, 2023 09:39
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
@rcrowley
rcrowley / grace.go
Last active March 1, 2023 16:06
Graceful stop in Go
package main
import (
"log"
"net"
"os"
"os/signal"
"sync"
"syscall"
"time"