Skip to content

Instantly share code, notes, and snippets.

@Kanst
Kanst / Links
Last active April 17, 2017 09:40
@Kanst
Kanst / s-des
Created October 22, 2015 15:29
#!/usr/bin/python
# -*- coding: utf-8 -*-
from collections import deque
import logging
import sys
##
text = list('10110110')
key = list('1111111100')
#!/usr/bin/python
import psycopg2
def main():
conn = psycopg2.connect(database='assa', user='assa', password='assa', host='192.168.56.120', port='5432')
conn.autocommit = True
cur = conn.cursor()
cur.execute("select 1")
#!/usr/bin/python
# -*- coding: utf-8 -*-
import copy
import sys
from pprint import pprint
max = 16
graf = {1: {4: 3, 'v': 1}, 2: {5: 1, 'v': 3}, 3: {13: 3, 'v': 2},
#!/usr/bin/python
# -*- coding: utf-8 -*-
import copy
import sys
from pprint import pprint
max = 16
graf = {1: {4: 3, 'v': 1}, 2: {5: 1, 'v': 3}, 3: {13: 3, 'v': 2},
@Kanst
Kanst / main.sh
Last active August 29, 2015 14:08
#!/bin/bash
## Default
ignore_errors='no'
## Default
usage() {
cat<<HELP
SYNOPSIS
$0 [ OPTIONS ]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pprint import pprint
inp = [
{
'type': 'input',
'result': ['a','b','c','d']
},
@Kanst
Kanst / pixel.coffee
Created April 16, 2014 13:57
Dashing-Pixel
class Dashing.Pixel extends Dashing.Widget
# ready: ->
# setInterval(@startCountdown, 2000)
# startCountdown: =>
# $("#table1").toggle()
# $("#table2").toggle()
# onData: (data) ->
# if data.rows1
@Kanst
Kanst / table.coffee
Created April 16, 2014 13:56
Dashing Table
class Dashing.Table extends Dashing.Widget
# ready: ->
# setInterval(@startCountdown, 2000)
# startCountdown: =>
# $("#table1").toggle()
# $("#table2").toggle()
# onData: (data) ->
# if data.rows1
@Kanst
Kanst / alllist.coffee
Last active August 29, 2015 13:59
dashing_list
class Dashing.Alllist extends Dashing.Widget
onData: (data) ->
@_checkStatus(data.widget_class)
_checkStatus: (status) ->
$(@node).removeClass('failed pending passed')
$(@node).addClass(status)
ready: ->
if @get('unordered')
$(@node).find('ol').remove()