Skip to content

Instantly share code, notes, and snippets.

View svartalf's full-sized avatar
💭
I may be slow to respond.

svartalf svartalf

💭
I may be slow to respond.
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>acpiacad0</key>
<array>
<dict>
<key>cur-value</key>
<integer>1</integer>
<key>description</key>

Keybase proof

I hereby claim:

  • I am svartalf on github.
  • I am svartalf (https://keybase.io/svartalf) on keybase.
  • I have a public key whose fingerprint is 85F7 3CA8 6EA8 C7C6 D7EE 378A EB19 FE3C 2BA3 5D68

To claim this, I am signing this object:

print-type-size type: `protocol::response::Response`: 48 bytes, alignment: 8 bytes
print-type-size field `.opcode`: 1 bytes
print-type-size padding: 1 bytes
print-type-size field `.key_length`: 2 bytes, alignment: 2 bytes
print-type-size field `.extras_length`: 1 bytes
print-type-size field `.data_type`: 1 bytes
print-type-size field `.status`: 1 bytes
print-type-size padding: 1 bytes
print-type-size field `.body_length`: 4 bytes, alignment: 4 bytes
print-type-size field `.opaque`: 4 bytes
@svartalf
svartalf / inpage_linkid.js
Created September 4, 2014 02:26
Google analytics with an injected ads script (have no idea who are doing that)
var e=document;window._gaq||eval("var _gaq = [];");_gaq.push(["_provide","inpage_linkid",f]);
function f(c,g){var l=/(?:^__utmli=|; ?__utmli=)([^;]*)/,d=this,m=function(a,b,d,c){var h="addEventListener",k="attachEvent";if(a[h])a[h](b,d,!!c);else if(a[k])a[k]("on"+b,d)};this.e=function(){return"; path=/"};var n=c._trackPageview;c._trackPageview=function(a){d.a();d.f&&c._setXKey(12,1,d.f);n.call(c,a)};this.g=function(){this.i||(this.i=!0,m(e,"click",function(a){d.h(a)}))};this.h=function(a){try{a=a||window.event;var b=a.target||a.srcElement;for(a=0;3>a&&!b.id&&b!=e.body;a++)b=b.parentNode;var c=
b.id||"";d.d(c)}catch(g){}return!0};this.b=function(a,b){f.prototype[a]=b};this.d=function(a){if(a&&100>a.length){a=a.replace(/[^-0-9a-z_:.]/gi,"");var b=new Date((new Date).getTime()+3E4);e.cookie="__utmli="+a+"; expires="+b.toUTCString()+this.e()}else this.a()};this.b("trackClickId",this.d);this.a=function(){e.cookie="__utmli=; expires=Thu, 01-Jan-1970 00:00:01 GMT"+this.e()};this.b("deleteClickId",this.a);this.c=func
@svartalf
svartalf / 5-query.json
Created July 25, 2014 00:14
ElasticSearch geo_bounds aggregation failure on precision levels 6 and 7
{
"query": {
"filtered": {
"filter": {
"geo_bounding_box": {
"point": {
"bottom_right": {
"lat": 52.13421310595936,
"lon": 104.59433337443919
},
curl -XGET "http://localhost:9200/postings/_search" -d '{
"query": {
"filtered": {
"filter": {
"geo_bounding_box": {
"point": {
"bottom_right": [
104.45856200712711,
52.208730692828844
],
@svartalf
svartalf / uwsgi.ini
Last active January 4, 2016 18:39
Trying to make a uwsgi + fastrouter + workers warming up. NOT WORKING NOW!
[uwsgi]
master = true
socket = 127.0.0.1:8080
pidfile = /tmp/svartalf.pid
processes = 4
home = /home/svartalf/projects/svartalf/.env
pythonpath = /home/svartalf/projects/svartalf/
mount = /=/home/svartalf/projects/irk/wsgi.py
enable-threads = true
optimize = 1
@svartalf
svartalf / varnish.vcl
Created January 17, 2014 03:28
Simple varnish config which will cache all responses with a X-Varnish-Age header.
import std;
backend default {
.host = "127.0.0.1";
.port = "8000";
}
sub vcl_recv {
return (lookup);
@svartalf
svartalf / gist:8054998
Created December 20, 2013 13:47
starbound error
Info: Initialized SDL
Info: Initialized SDL Video
Info: Initialized SDL Joystick
Info: Initialized SDL Sound
Info: Opened default audio device with 44khz / 16 bit stereo audio, 940 sample size buffer
Error: Error loading player file, ignoring! IOException: Wrong magic bytes at start of versioned blob, expected 'SBPFV1.1'
./starbound(_ZN4Star13StarExceptionC2ERKSs+0xe7) [0x8883077]
./starbound() [0x8593db9]
./starbound() [0x84ce1ec]
./starbound(_ZNSt23_Sp_counted_ptr_inplaceIN4Star13PlayerStorageESaIS1_ELN9__gnu_cxx12_Lock_policyE2EEC2IINS0_6StringEEEES2_DpOT_+0x44) [0x81cdd64]
@svartalf
svartalf / fluentd_handler.py
Created December 11, 2013 06:23
python log handler for fluent tcp transport
# -*- coding: utf-8 -*-
from logging.handlers import SocketHandler
import msgpack # https://pypi.python.org/pypi/msgpack-python
class FluentdHandler(SocketHandler):
def __init__(self, host='localhost', port=24224):