Skip to content

Instantly share code, notes, and snippets.

@textarcana
textarcana / lol.md
Last active January 13, 2020 15:20
The most comprehensive list of programmer jokes on the internet. Period. (Comprehensiveness of this list is in no way guaranteed. Statements of comprehensiveness are not meant to imply comprehensiveness. Use jokes at your own risk.) LICENSE: Creative Commons Sharealike

Comprehensive list of programmer jokes

How many programmers does it take to change a lightbulb?
Only one. But then the whole house falls down.
How many programmers does it take to change a lightbulb?
None. That is a hardware problem.
How many programmers does it take to change a lightbulb?
This is a known issue. When we installed the lightbulb we knew it had a finite TTL.
How many programmers does it take to change a lightbulb?
@kennwhite
kennwhite / 1944_OSS_Simple_Sabotage_Field_Manual.md
Last active November 9, 2024 03:51
1944 OSS Simple Sabotage Field Manual
# THIS CODE IS NOW RETIRED. GO TO THE NEW REPOSITORY: https://github.com/brakmic/TwitterClient
# -*- coding: utf-8 -*-
#==============================================================================
# A simple console-based twitter client capable of persisting data
# Usage: python client.py --config=your_json_config.json
# To persist to a database a valid DNS entry is needed.
# Also, create a proper Tweets table. Check 'insert' method in DbConnector.
# =============================================================================
@slaypni
slaypni / xgb.py
Last active September 24, 2021 17:35
A wrapper class of XGBoost for scikit-learn
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import math
import numpy as np
sys.path.append('xgboost/wrapper/')
import xgboost as xgb
@willurd
willurd / web-servers.md
Last active November 13, 2024 13:44
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
@stucchio
stucchio / beta_bandit.py
Last active April 3, 2022 21:17
Beta-distribution Bandit
from numpy import *
from scipy.stats import beta
class BetaBandit(object):
def __init__(self, num_options=2, prior=(1.0,1.0)):
self.trials = zeros(shape=(num_options,), dtype=int)
self.successes = zeros(shape=(num_options,), dtype=int)
self.num_options = num_options
self.prior = prior
@Palleas
Palleas / upload-attachment.py
Created March 18, 2013 13:08
Upload a file to confluence using python
#!/usr/bin/python
from __future__ import with_statement
import sys, string, xmlrpclib, re, os
if len(sys.argv) < 5:
exit("Usage: " + sys.argv[0] + " spacekey pagetitle contentType filename");
spacekey = sys.argv[1];
pagetitle = sys.argv[2];
@mathiasverraes
mathiasverraes / .bashrc
Created November 3, 2011 18:46 — forked from thomasvm/.bashrc
Git shortcuts
#! /bin/sh
alias gs="git status"
alias gc="git commit"
alias gr="git checkout"
alias ga="git add"
alias gl="git lola"