Skip to content

Instantly share code, notes, and snippets.

@draggor
draggor / base33.py
Last active August 6, 2019 17:26
weechat base33 numbering
import weechat
BASE = '0123456789abcdefghjkmnpqrstuvwxyz'
def str_base_33(number, base):
(d,m) = divmod(number,len(base))
if d > 0:
return str_base_33(d,base)+base[m]
return base[m]
@draggor
draggor / gist:ca2997279d29563b8b1e691e01ba3580
Created November 13, 2017 01:44
Character causing issue in tmux but not outside of tmux
: 😗
### Keybase proof
I hereby claim:
* I am draggor on github.
* I am draggor (https://keybase.io/draggor) on keybase.
* I have a public key whose fingerprint is F8AB CA4D F0B7 C9B8 5297 8C5A 5151 88B8 9DCC 9716
To claim this, I am signing this object:
@draggor
draggor / forms.py
Created April 3, 2015 01:36
Fields order example
# inherited from https://github.com/GoodCloud/django-zebra/blob/master/zebra/forms.py
class RegistrationForm(StripePaymentForm):
badgeName = forms.CharField(max_length=50, label="Badge Name:")
firstName = forms.CharField(max_length=50, label="First Name:")
lastName = forms.CharField(max_length=50, label="Last Name:")
class Meta:
fields = (
'badgeName',
function latch(n, done, notDone) {
return function() {
if(--n === 0) {
done();
} else if(n > 0) {
notDone(n);
}
}
}
14:39:24 oscar: Sending IM, charset=0x0000, length=55
14:39:24 oscar: rate change (param ID 0x0001): curavg = 6000, maxavg = 6000, alert at 2000, clear warning at 2500, limit at 1500, disconnect at 800, delta is 63156, dropping is 0 (window size = 80)
14:39:24 oscar: Sent message to ascreenname.
14:39:32 oscar: Parsing IM, charset=0x0000, datalen=86, choice1=ASCII, choice2=ISO-8859-1, choice3=
14:39:32 oscar: Received IM from ascreenname
14:39:32 oscar: ascreenname has an icon
14:39:33 oscar: Sending buddy icon request with message
14:39:33 oscar: Sending IM, charset=0x0000, length=48
14:39:33 oscar: rate change (param ID 0x0001): curavg = 6000, maxavg = 6000, alert at 2000, clear warning at 2500, limit at 1500, disconnect at 800, delta is 72126, dropping is 0 (window size = 80)
14:39:33 oscar: Sent message to ascreenname.
1 {% extends "site_base.html" %}
2
3 {% load sitetree %}
4 {% load i18n %}
5
6 {% block body_class %}cms-page{% endblock %}
7
8 {% block head_title %}{{ page.title }}{% endblock %}
9
10 {% block breadcrumbs %}{% sitetree_breadcrumbs from "main" %}{% endblock %}
@draggor
draggor / gist:3248321
Created August 3, 2012 14:52
Socket hang up
info: Creating snapshot 0.0.5-2
info: Updating app ircbot
info: Activating snapshot 0.0.5-2 for ircbot
info: Starting app ircbot
error: Error running command deploy
@draggor
draggor / gist:1882963
Created February 22, 2012 07:11
tester
#include <iostream>
#include "Number.h"
using namespace std;
int main()
{
Number n(10);
cout << "n.toString() 10=" << n.toString() << endl;
@draggor
draggor / gist:1881910
Created February 22, 2012 05:59
thing
#include <iostream>
using namespace std;
class Thing{
public:
int* val;
Thing() {}