Skip to content

Instantly share code, notes, and snippets.

View LEW21's full-sized avatar

Linus Lewandowski LEW21

View GitHub Profile
@LEW21
LEW21 / resources.yaml
Last active August 3, 2017 15:20
12factor - required resources
DATABASE_URL:
accept: # Listed in the order of preference
- protocol: postgres
- protocol: mysql
EMAIL_URL:
accept:
- protocol: smtp
SENTRY_URL:
/
- id: url
name: PHP
votes: 9001
top_reasons:
- id: url
name: I'ts a fractal
link: dasdas
votes: 6666
(env) [lew21@apollo whyitsux]$ ./manage.py migrate
Traceback (most recent call last):
File "/home/lew21/WhyItSux/env/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/lew21/WhyItSux/env/lib/python3.5/site-packages/django/db/backends/sqlite3/base.py", line 337, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: django_site
The above exception was the direct cause of the following exception:
@LEW21
LEW21 / cudacore.diff
Created May 24, 2015 23:29
gpunode-cudacore vs cudacore
diff -ur gpunode-cudacore/RTQuery.cuh cudacore/RTQuery.cuh
--- gpunode-cudacore/RTQuery.cuh 2015-05-25 01:17:50.780401283 +0200
+++ cudacore/RTQuery.cuh 2015-05-25 01:17:46.931636701 +0200
@@ -1,3 +1,6 @@
+#ifndef RTQUERY_H_
+#define RTQUERY_H_
+
#define RTCUBE_OP_NONE 0
#define RTCUBE_OP_SUM 1
#define RTCUBE_OP_MAX 2
@LEW21
LEW21 / tvpdl.py
Created May 5, 2015 16:29
TVP ISM/MP4 URL finder
import requests
import re
import sys
url = sys.argv[1]
prefix, url_id = url.rsplit("/", 1)
id = int(url_id)
player_url = "http://www.tvp.pl/sess/tvplayer.php?object_id=" + url_id
@LEW21
LEW21 / pydbus_tab_completion.html
Created May 5, 2015 07:16
pydbus tab completion demo
<html>
<head>
<title>pydbus tab completion demo</title>
<style>
div {
position: relative;
display: inline-block;
width: 780px;
height: 460px;
}
@LEW21
LEW21 / getpkw.py
Created November 20, 2014 12:26
Skrypt pobierający wszystkie dane PKW ze strony http://klk.kbw.gov.pl/kalkulator/20141116/000000/SMD/
import requests
import re
import time
import sys
def URL(teryt):
while teryt[-2:] == "00":
teryt = teryt[:-2]
url = "http://klk.kbw.gov.pl/kalkulator/20141116/000000/SMD"
if len(teryt) > 0:
@LEW21
LEW21 / config.ru
Created August 1, 2014 22:48
Gollum HTTP Basic Auth
require 'gollum/app'
class GollumAuth
User = Struct.new(:name, :email, :password_hash)
def users
if @_users
return @_users
end
all_users = YAML.load_file(File.expand_path('users.yml', File.dirname(__FILE__)))
#include <string>
#include <iostream>
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/variables_map.hpp>
#include "soa/service/service_utils.h"
using namespace std;
using namespace Datacratic;
auto readConfig(int argc, char** argv) -> ServiceProxyArguments