Skip to content

Instantly share code, notes, and snippets.

My model for assessing trust with people.

  1. Random strangers
  2. Acquaintances
  3. Most friends that are more than acquaintances
  4. Close friends
  5. Only me
@myano
myano / gist:5844270
Last active December 18, 2015 20:59

Rules for ##uno on freenode

  • No additional bots in the channel. Only ChanServ and jenni are allowed.
  • No automated scripts. (eg: No automatic /me's or messages when you go "away")
  • No personal insults.
  • No cheating.
  • Do not highlight nicks unless you are conversing with said person or persons.
  • Do not spam the channel with non-relevant commands to the current game.
  • Do not beg/insist the ops ban somebody.
@myano
myano / irc_games.md
Last active March 20, 2024 11:07
This is a list of games that are playable on IRC.

List of on-IRC games

AlphaChat

  • #multirpg

BakaShiMoe

@myano
myano / gitio.md
Last active December 16, 2015 23:39

Create git.io Short URLs in Python

git.io is an awesome URL shortener provided by Github. It works when shortening URLs from *.github.com/* to a small https://git.io/ link.

requests

>>> import requests
@myano
myano / index.md
Last active August 25, 2021 11:56
Merging forked gists into your gist to preserve the history of the gist.

Merging A Forked Gist Into Your Gist

Let's say you have a gist (public or private) and someone forks it and makes changes to it. Awesome! However, now you want to merge in their changes to your gist. Unfortunately, it doesn't seem GitHub supports this via their website at the moment, however, you can still merge the gists with 'git' on the command line.

  1. You want to clone your gist. You can locate the link for this under "Clone this gist"

     ➜  ~/dev » git clone https://gist.github.com/5315168.git
     Cloning into '5315168'...
    

remote: Counting objects: 6, done.

@myano
myano / join.py
Last active December 14, 2015 03:29
If you have saved your buffers in WeeChat with "/layout save", this script will print out an easy to copy/paste "/join #channel1,#channel2" that you can paste into WeeChat to join channels. If you have a lot of channels (more than 100). I would recommend joining only about 75-100 channels at a time.
#!/usr/bin/env python
import copy
f = open('weechat.conf', 'r')
formats = ['/join ', '/query ']
networks = {
@myano
myano / gist:5016700
Last active December 14, 2015 02:49
This will convert a given password "foobar" into the SHA output that Apache uses for it's .htpasswd files. You can take the output of this command and simply append it with a "username_here:{SHA}" and then place it into a .htpasswd is pointing at. This is useful if you want someone to generate a password for you but they don't have Apache instal…

Without salt:

$ echo -n "foobar" | sha1sum | cut -d' ' -f1 | xxd -r -p | base64

With salt:

$ USR="yourname";PWD="foobar";SALT="$(openssl rand -base64 3)";SHA1=$(printf "$PWD$SALT" | openssl dgst -binary -sha1 | sed 's#$#'"$SALT"'#' | base64); echo "$USR:{SSHA}$SHA1"

@rduplain
rduplain / slides.md
Last active February 7, 2019 15:40
Use Werkzeug's web-based interactive debugger with Tornado.

Interactive Debugging in any Python Web Project

Ron DuPlain - PyOhio 2013

Turn this:

@ikks
ikks / goo.gl.py
Created May 31, 2012 19:43
Using goo.gl from python 2.X Where X is 6 or more
#Given to the public domain
#No warranties
import urllib2
import simplejson
def shorturl(urltoshorten):
"""Compress the URL using goo.gl take a look at https://developers.google.com/url-shortener/v1/getting_started
>>> shorturl('http://igor.tamarapatino.org')
'http://goo.gl/FxHOn'
@silasb
silasb / .htaccess
Created March 30, 2012 17:16
GZip JS/CSS
AddEncoding gzip gz
RewriteEngine On
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)$ $1.gz [QSA,L]
<Files *.css.gz>
ForceType text/css