Skip to content

Instantly share code, notes, and snippets.

Avatar

Simon Pantzare pilt

View GitHub Profile
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.background {
fill: none;
pointer-events: all;
}
.feature {
View gist:9ce91f47b616530c3160
### Keybase proof
I hereby claim:
* I am pilt on github.
* I am pilt (https://keybase.io/pilt) on keybase.
* I have a public key whose fingerprint is 1471 CD99 DDD9 52C2 9000 2C14 243B 7C0A 6685 D9B2
To claim this, I am signing this object:
@pilt
pilt / A.md
Last active Aug 29, 2015
Sverigedemokraternas valfilm
View A.md

Transkription av Sverigedemokraternas valfilm. Det här tilltalar alltså en av tio svenskar?

tl;dr: Missnöje med etablissemanget, "eliten" och media. Invandring är orsaken till alla problem. Förrkärlek.

View 00_tables.sql
DROP TABLE IF EXISTS sender;
CREATE TABLE sender (
id INTEGER PRIMARY KEY,
name,
city
);
DROP TABLE IF EXISTS product;
CREATE TABLE product (
id INTEGER PRIMARY KEY,
View output.py
((u'ebs', u'amd64', u'ap-northeast-1'), u'ami-eca719ed')
((u'ebs', u'i386', u'ap-northeast-1'), u'ami-eaa719eb')
((u'instance-store', u'amd64', u'ap-northeast-1'), u'ami-e0a719e1')
((u'instance-store', u'i386', u'ap-northeast-1'), u'ami-aca719ad')
((u'ebs', u'amd64', u'ap-southeast-1'), u'ami-fefcbcac')
((u'ebs', u'i386', u'ap-southeast-1'), u'ami-f8fcbcaa')
((u'instance-store', u'amd64', u'ap-southeast-1'), u'ami-fafcbca8')
((u'instance-store', u'i386', u'ap-southeast-1'), u'ami-d4fcbc86')
((u'ebs', u'amd64', u'ap-southeast-2'), u'ami-fb8611c1')
((u'ebs', u'i386', u'ap-southeast-2'), u'ami-858611bf')
View auhtorization.py
from memsite.base.api.authorization import MemAuthorization
class DeviceAuthorization(MemAuthorization):
def apply_limits(self, request, object_list):
if request.user.is_authenticated():
return self.apply_user_profile_limits(request, object_list)
return object_list.none()
View foo.py
if "HTTP_AUTHORIZATION" in self.request.META:
authorization = self.request.META["HTTP_AUTHORIZATION"]
auth_type, auth_value = authorization.split()[0:2]
if auth_type.lower() == "basic":
credentials = "%s:%s" % (self.client.key, self.client.secret)
if auth_value != b64encode(credentials):
raise InvalidClient('Client authentication failed.')
else:
raise InvalidClient('Client authentication failed.')
else:
@pilt
pilt / about.md
Created Aug 31, 2012 — forked from FSX/about.md
Programming Achievements: How to Level Up as a Developer
View about.md

Programming Achievements: How to Level Up as a Developer

  1. Select a particular experience to pursue.
  2. Pursue that experience to completion. (Achievement unlocked!)
  3. Reflect on that experience. Really soak it in. Maybe a blog post would be in order?
  4. Return to Step 1, this time selecting a new experience.

*This gist is a fork of the gist from [this blog post][1] and this [Gist][2].

@pilt
pilt / sample_output.py
Created Jun 20, 2012
Scrape aws.amazon.com for Amazon Linux AMI ids
View sample_output.py
{('ebs', 'cluster_compute', 'us-east-1'): 'ami-e965ba80',
('ebs', 'cluster_gpu', 'us-east-1'): 'ami-fd65ba94',
('ebs', 'i386', 'ap-northeast-1'): 'ami-087acb09',
('ebs', 'i386', 'ap-southeast-1'): 'ami-b83374ea',
('ebs', 'i386', 'eu-west-1'): 'ami-fd231b89',
('ebs', 'i386', 'sa-east-1'): 'ami-aa855bb7',
('ebs', 'i386', 'us-east-1'): 'ami-ed65ba84',
('ebs', 'i386', 'us-west-1'): 'ami-978cd4d2',
('ebs', 'i386', 'us-west-2'): 'ami-38c64a08',
('ebs', 'x86_64', 'ap-northeast-1'): 'ami-e47acbe5',
@pilt
pilt / results
Created Jun 15, 2012
Riak storage comparisons
View results
Test case
----------
Riak version 1.1.2. Insert 5,000 items. Do it five times and compute
means. The data dir size is calculated before and after iterations.
Bitcask vs. LevelDB
-------------------
Disk space: 1.113 : 1.000
Time taken: 1.000 : 1.016
You can’t perform that action at this time.