Skip to content

Instantly share code, notes, and snippets.

View spscream's full-sized avatar

Alexander Malaev spscream

View GitHub Profile
Model (call 'Model.connection' to establish a connection)
unknown OID 24: failed to recognize type of 'typinput'. It will be treated as String.
unknown OID 194: failed to recognize type of 'typdefaultbin'. It will be treated as String.
unknown OID 1034: failed to recognize type of 'typacl'. It will be treated as String.
Model(typname: string, typnamespace: integer, typowner: integer, typlen: integer, typbyval: boolean, typtype: string, typcategory: string, typispreferred: boolean, typisdefined: boolean, typdelim: string, typrelid: integer, typelem: integer, typarray: integer, typinput: , typoutput: , typreceive: , typsend: , typmodin: , typmodout: , typanalyze: , typalign: string, typstorage: string, typnotnull: boolean, typbasetype: integer, typtypmod: integer, typndims: integer, typcollation: integer, typdefaultbin: , typdefault: text, typacl: )
initial state:
reserved: {#<Thread:0x007f81f18cb7c8 run>=>70098044115400}
non_leaker:
@Onespend.module 'Behaviors', (Behaviors, App, Backbone, Marionette, $, _) ->
Behaviors.Dropdown = Marionette.Behavior.extend
initialize: ->
@dropdownShowed = false
ui:
'dropdown': '.js-dropdown'
'header': '.js-header'
define ['backbone', 'marionette'], (Backbone, Marionette) ->
App = new Marionette.Application
App.on 'start', ->
App.vent.on 'auth:login', ->
console.log "Login"
App.vent.on 'auth:logout', ->
console.log "logout"
define ['backbone', 'marionette', 'config/backbone/auth'], (Backbone, Marionette, Auth) ->
App = new Marionette.Application
App.auth = new Auth
App.auth.login
email: '[email protected]'
password: 'password'
App.auth.on 'logged_in', ->
#!/usr/bin/env python3
import gi
import os
from datetime import datetime
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst, Gtk
from gi.repository import GdkX11, GstVideo
from gi.repository.Gtk import Window, VBox, HBox, DrawingArea, ToggleButton, Button, Statusbar
#!/usr/bin/env python3
import gi
import os
from datetime import datetime
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst, Gtk
from gi.repository import GdkX11, GstVideo
from gi.repository.Gtk import Window, VBox, HBox, DrawingArea, ToggleButton, Button, Statusbar
#!/usr/bin/env python3
import gi
import os
from datetime import datetime
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst, Gtk
from gi.repository import GdkX11, GstVideo
from gi.repository.Gtk import Window, VBox, HBox, DrawingArea, ToggleButton, Button, Statusbar
import sys;g=open(sys.argv[1]).next;n=range
for o in n(int(g())):
r,p,c=('',0,g()[:-1])
for w in g()[:-1]:
if w==" ":r+=w
else:r+=chr(n(97,123)[ord(w)-97-int((c+c[::-1])[p%len(c*2)])]);p+=1
print r
import sys,mmap;a=sys.argv;c=1
with open(a[2],'rb') as f:
m=mmap.mmap(f.fileno(),0,prot=1)
r=m.find(a[1])
o=len(m.read(r).split('\n')) if r>=0 else 0
print o
@spscream
spscream / gist:4611147
Last active December 11, 2015 13:58
Gist of puzzle 'barrel-cypher' solving. http://www.codercharts.com/puzzle/barrel-cypher
import sys;g=open(sys.argv[1]).next;n=range
for o in n(int(g())):
r,p,c=('',0,g()[:-1])
for w in g()[:-1]:
if w==" ":r+=w
else:r+=chr(n(97,123)[ord(w)-97-int((c+c[::-1])[p%len(c*2)])]);p+=1
print r