Skip to content

Instantly share code, notes, and snippets.

View lig's full-sized avatar
🛴
kicking it

Serge Matveenko lig

🛴
kicking it
View GitHub Profile
@lig
lig / commit.py
Created March 30, 2020 09:15
pygit2 create commit simple
import pygit2
repo = pygit2.Repository(path='.')
repo.index.add_all()
repo.index.write()
tree = repo.index.write_tree()
parent, ref = repo.resolve_refish(refish=repo.head.name)
repo.create_commit(
@lig
lig / super.py
Last active May 14, 2020 12:13
super() outside of a class
>>> class A:
... def foo(self):
... return 5
>>> class B(A):
... def foo(self):
... return 3
>>> b = B()
@lig
lig / index.html
Created May 20, 2016 14:38
IT talk - DataArt - Voronezh - Trip Planner
<!doctype html>
<html lang="en" ng-app="plannerApp">
<head>
<title>IT talk - DataArt - Voronezh - Trip Planner</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet"
href="https://rawgit.com/kuhnza/angular-google-places-autocomplete/master/dist/autocomplete.min.css">

Keybase proof

I hereby claim:

  • I am lig on github.
  • I am lig (https://keybase.io/lig) on keybase.
  • I have a public key whose fingerprint is 1F69 B222 54B1 020E 376E A124 7975 FCE7 7887 3B13

To claim this, I am signing this object:

@lig
lig / gitmoji.tsv
Last active April 16, 2019 08:30
The gitmoji set for emoji-cli
art structure,format
zap performance,optimization
fire burn,remove,discard
bug bug,fix
ambulance critical,hotfix
sparkles new,feature
memo memo,docs,readme,note
rocket deploy,ship
lipstick ui,style
tada initial,first,init
@lig
lig / f.pyx
Created April 10, 2018 09:55
Nasty f-string hacks
In [1]: foo = {}
In [2]: f'r u a hacker or wat? {foo.update(a=1)} {locals().update(b="ham")}'
Out[2]: 'r u a hacker or wat? None None'
In [3]: foo
Out[3]: {'a': 1}
In [4]: b
Out[4]: 'ham'
@lig
lig / .conkyrc
Last active January 19, 2018 06:45
Conky config. Gnome 3 compatible.
conky.config = {
alignment = 'tl',
background = true,
border_width = 1,
default_bar_width = 256, default_bar_height = 4,
default_color = 'white',
default_outline_color = 'white',
default_shade_color = 'black',
double_buffer = true,
draw_borders = false,
@lig
lig / log.sh
Last active April 19, 2017 05:20
stdouterr
$ python3 stdouterr.py
stdout
stderr
$ python3 stdouterr.py 2>&1 >/dev/null
stderr
$ python3 stdouterr.py &>/dev/null
$ python3 stdouterr.py >/dev/null 2>&1
$ python3 stdouterr.py >/dev/null
stderr
@lig
lig / gist:6756865
Last active December 24, 2015 06:29
$PS1
PS1="« \[\e[1;32m\]\u@\h \[\e[1;34m\]\w\[\e[0m\] »\n\[\e[0;37m\]$\[\e[0m\] "