Skip to content

Instantly share code, notes, and snippets.

View skakri's full-sized avatar
🖱️
Click to enable Adobe Flash Player

Kristaps Karlsons skakri

🖱️
Click to enable Adobe Flash Player
View GitHub Profile
// Comments and commas for syntax
highlighting = [
//POST test
{
"settings": {
"analysis": {
"filter": {
"synonym": {
"synonyms_path": "/usr/share/wordnet-prolog/wn_s.pl",
@skakri
skakri / rails_tz.py
Created August 26, 2014 15:35 — forked from amitu/rails_tz.py
{
"Abu Dhabi": "Asia/Muscat",
"Adelaide": "Australia/Adelaide",
"Alaska": "America/Juneau",
"Almaty": "Asia/Almaty",
"American Samoa": "Pacific/Pago_Pago",
"Amsterdam": "Europe/Amsterdam",
"Arizona": "America/Phoenix",
"Astana": "Asia/Dhaka",
"Athens": "Europe/Athens",
@skakri
skakri / broadcast-ip.sh
Created April 30, 2015 12:40
broadcast-ip.sh
#!/bin/sh
# Broadcasts IP on 20420 (UDP) to local network.
# To get IP of this device, run `nc -ul 20420` and wait a bit.
ip -o -4 addr show | awk -F '[ /]+' '/global/ {print $4}' | socat - "UDP-DATAGRAM:255.255.255.255:20420,broadcast"
@skakri
skakri / vunits.js
Last active August 29, 2015 14:25 — forked from LeaVerou/vunits.js
/**
* Polyfill for the vw, vh, vm units
* Requires StyleFix from -prefix-free http://leaverou.github.com/prefixfree/
* @author Lea Verou
*/
(function() {
if(!window.StyleFix) {
return;
@skakri
skakri / doot.c
Created September 14, 2015 17:42
#include <stdio.h>
int main(int argc, char* argv[]){
printf("%c",~~-~~~-~~~~-~~~~~-~~'2'+'2');
printf("%c",-~~~-~~~~~~~-~~~~~~~'3'+'3');
printf("%c",~-~~~~~-~~~~~-~~~-~-'4'+'4');
printf("%c",~~~-~~-~~~-~~-~~-~~~'5'+'5');
printf("%c",~-~-~-~-~-~-~-~-~-~-'6'+'6');
printf("%c",~~-~-~-~~~-~-~~~-~-~'7'+'7');
printf("%c",~~-~-~~~-~~~~~~~-~~~'8'+'8');
printf("%c",~~~-~~-~~~-~~~~~-~~~'9'+'9');
Building wheels for collected packages: django-grappelli, django-imagekit, django-haystack, django-taggit-labels, django-wysiwyg-redactor, django-reversion, Pillow, psycopg2, sh, pilkit
Running setup.py bdist_wheel for django-grappelli
Stored in directory: /home/skakri/.cache/pip/wheels/70/62/e6/34b93f49018597d842f29ed28a4ceb04612cca41dce9c35b35
Running setup.py bdist_wheel for django-imagekit
Stored in directory: /home/skakri/.cache/pip/wheels/e5/01/97/684d4d8b68ad1874fcc158117c309875514bbb2512ffdc345f
Running setup.py bdist_wheel for django-haystack
Stored in directory: /home/skakri/.cache/pip/wheels/c2/71/28/0b02057e76b39e29b18c8c38a06e05def283e0d3a0d7dd5813
Running setup.py bdist_wheel for django-taggit-labels
Stored in directory: /home/skakri/.cache/pip/wheels/2e/0c/bb/1e5d9293ee93569cae3d06eeacaa9080ab81c558705c5997fd
Running setup.py bdist_wheel for django-wysiwyg-redactor
@skakri
skakri / send_file_partial.py
Last active May 18, 2017 19:16 — forked from lizhiwei/send_file_partial.py
HTTP 206 (Partial Content) For Flask
import mimetypes
import os
import re
from flask import request, send_file, Response
@app.after_request
def after_request(response):
response.headers.add('Accept-Ranges', 'bytes')
return response
@skakri
skakri / 00readme.md
Created June 5, 2016 19:48 — forked from indrora/00readme.md
DeadUpdate: Kickin' it bigtime.

... my first disclosure. Man, it feels weird doing this.

From the vendor that brought you a
                        vulnerable cloud storage platform comes
                        
           ___              ____  __        __     __ 
          / _ \___ ___ ____/ / / / /__  ___/ /__ _/ /____ 
         / // / -_) _ `/ _  / /_/ / _ \/ _  / _ `/ __/ -_)

//_/_,/_,/_/ ./_,/_,/_/_/

@skakri
skakri / pca9685.lua.lua
Created August 29, 2016 19:33 — forked from anonymous/pca9685.lua.lua
pca9685.lua
local modname = ...
local M = {}
_G[modname] = M
local id = nil
local addr = nil
-- some flags from mode register, low byte is MODE1 and high is MODE2
M.INVERT = 0x1000
@skakri
skakri / spawn_once.lua
Created August 31, 2016 16:47 — forked from Flowkap/spawn_once.lua
This is a small gist for autostarting applications with Awesome Window Manager (http://awesome.naquadah.org/) without the need to use a third party plugin like shifty. It's maybe not nice but works!
-- {{{
--
-- Autostarting for Awesome <3.4!
-- Add this section to the end of your rc.lua
-- configuration file within ~/.config/awesome/rc.lua
--
-- If you're using Awesome 3.5 change:
-- add_signal -> connect_signal
-- remove_signal --> disconnect_signal
--