Skip to content

Instantly share code, notes, and snippets.

View phanirithvij's full-sized avatar
💫
you spin my head right round ..

loudgolem phanirithvij

💫
you spin my head right round ..
View GitHub Profile
@manveru
manveru / gears.go
Created May 24, 2010 13:06
Gears with SDL/OpenGL in Go
package main
import (
"sdl"
"gl"
"time"
. "math"
. "fmt"
)
@gourneau
gourneau / python-pil-image-sprite.py
Created April 24, 2011 02:45
Make sprites of images using Python and PIL
#!/usr/bin/python
# This work is licensed under the Creative Commons Attribution 3.0 United
# States License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by/3.0/us/ or send a letter to Creative
# Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
# from http://oranlooney.com/make-css-sprites-python-image-library/
# Orignial Author Oran Looney <[email protected]>
@slikts
slikts / gist:1159341
Created August 20, 2011 16:56
mangareader.net user CSS
#wrapper_header,
#adtop,
#topchapter,
#bottomchapter,
#adfooter,
#zoomer,
#wrapper_footer,
.zoomimg {
display: none;
}
@willurd
willurd / web-servers.md
Last active August 5, 2025 00:46
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@Chaser324
Chaser324 / GitHub-Forking.md
Last active August 11, 2025 11:41
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@jpillora
jpillora / smtp-gmail-send.go
Last active July 19, 2025 18:39
Send email using Go (Golang) via GMail with net/smtp
package main
import (
"log"
"net/smtp"
)
func main() {
send("hello there")
}
@harlow
harlow / golang_job_queue.md
Last active March 29, 2025 04:55
Job queues in Golang
package pool
type Task interface {
Execute(id int)
}
type Pool struct {
tasks chan Task
kill chan bool
}
@liulixiang1988
liulixiang1988 / app.py
Created August 14, 2015 03:02
upload multiple files in Flask
import os
# We'll render HTML templates and access data sent by POST
# using the request object from flask. Redirect and url_for
# will be used to redirect the user once the upload is done
# and send_from_directory will help us to send/show on the
# browser the file that the user just uploaded
from flask import Flask, render_template, request, redirect, url_for, send_from_directory
from werkzeug import secure_filename
# Initialize the Flask application
@qhwa
qhwa / go_port_forwarding.go
Last active September 8, 2024 19:01
network port forwarding in go lang
package main
import (
"fmt"
"io"
"net"
)
func main() {
ln, err := net.Listen("tcp", ":8080")