Skip to content

Instantly share code, notes, and snippets.

[based on a true story]

So. Your friend's about to teach you how to make a website. Great!

You make a file, and you save it as 'index.html'. Why it's called 'index' isn't really explained to you, but whatever.

You type the following.

hello world
@egh
egh / jabber-hipchat.el
Last active January 3, 2018 18:08
jabber.el hipchat setup
(require 's)
(require 'request)
(require 'seq)
(require 'jabber)
(defvar hipchat--user-info-for-completion nil)
(defcustom hipchat-nickname "Full name" "Hipchat real name (see see https://hipchat.com/account/xmpp)."
:type '(string)
@siddhant3s
siddhant3s / rsa_simple.py
Last active December 31, 2015 10:08
A very simple, inefficient and insecure implementation of RSA just for educational purpose. Only for learning how RSA works. On a usual implementation you would put conditions on the primes generated as suggested by the inventors of RSA (like they shouldn't be too close etc.). To study RSA, you can read from a textbook like one by William Stalli…
import random
def isProbablePrime(n):
'''
Miller-Rabin primality test.
from http://rosettacode.org/wiki/Miller-Rabin_primality_test#Python
'''
_mrpt_num_trials = 5 # number of bases to test
assert n >= 2
# special case 2
if n == 2: