Skip to content

Instantly share code, notes, and snippets.

View oz123's full-sized avatar
🎯
Focusing

Oz Tiram oz123

🎯
Focusing
View GitHub Profile
@oz123
oz123 / config.lua
Last active January 16, 2025 10:03
My lunar vim config- ~/.config/lvim/config.lua
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Example configs: https://github.com/LunarVim/starter.lvim
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny
--
lvim.plugins = {
{ "lunarvim/colorschemes" },
{ "HiPhish/rainbow-delimiters.nvim" }
}
@oz123
oz123 / gist:ade4528c87913077a8bbf88e864df234
Last active December 9, 2024 07:37
gio showing luks partition.
oznt@gentoo-elli ~ $ gio mount -l
Drive(0): TS1TMTE220S
Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
Drive(1): SanDisk Ultra II 480GB
Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
Volume(0): 479 GB Encrypted
Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
Volume(1): 767 MB Volume
Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
oznt@gentoo-elli ~ $
@oz123
oz123 / flatten.go
Last active April 25, 2019 08:49
Flatten a list of lists in Python and Go
package main
import (
"encoding/json"
"fmt"
)
func flatten(s []interface{}) (r []int) {
// type switch already discussed in the tour of go
for _, item := range s {
@oz123
oz123 / upload.js
Created February 12, 2019 20:32
using openpgp to encrypt uploaded file.
import "babel-polyfill";
var openpgp = require('openpgp'); // use as CommonJS, AMD, ES6 module or via window.openpgp
const query = query => document.querySelector(query);
const queryAll = query => Array.prototype.slice.apply(document.querySelectorAll(query));
const pub_key =
['-----BEGIN PGP PUBLIC KEY BLOCK-----',
'Version: GnuPG v2.0.22 (GNU/Linux)',
@oz123
oz123 / men
Created October 1, 2018 09:14
german population register 2016
Stadt,"Post-leitzahl 1)","Fläche in km2 2)",männlich
"Berlin, Stadt",10178,891.12,1755700
"Hamburg, Freie und Hansestadt",20038,755.3,886289
"München, Landeshauptstadt",80331,310.71,714112
"Köln, Stadt",50667,405.02,524790
"Frankfurt am Main, Stadt",60311,248.31,363754
"Stuttgart, Landeshauptstadt",70173,207.33,313295
"Düsseldorf, Stadt",40213,217.41,296231
"Dortmund, Stadt",44135,280.71,287897
"Essen, Stadt",45127,210.34,283065
@oz123
oz123 / app.py
Created July 26, 2017 12:26
basic bottle authentication
from bottle import Bottle, auth_basic, request, run
app = Bottle()
def check(user, passwd):
if user == 'oz123':
return True
return False
import asyncio
loop = asyncio.get_event_loop()
async def hello():
await asyncio.sleep(3)
print('Hello!')
if __name__ == '__main__':
loop.run_until_complete(hello())
@oz123
oz123 / kombu_example.py
Last active February 27, 2017 15:07 — forked from vgoklani/kombu_example.py
update for Python3
from kombu import Exchange
from kombu import Queue
from kombu import BrokerConnection
class ProduceConsume(object):
def __init__(self, exchange_name, **options):
exchange = Exchange(exchange_name, type='fanout', durable=False)
queue_name = options.get('queue', exchange_name+'_queue')
self.queue = Queue(queue_name ,exchange)
#!/usr/bin/python
from __future__ import division
import math
import time
import cairo
import gi
gi.require_version('Gtk', '3.0')
@oz123
oz123 / sessiontest.py
Created September 11, 2016 07:24 — forked from thedemz/sessiontest.py
Example of using beaker sessions with bottle
import bottle
from beaker.middleware import SessionMiddleware
session_opts = {
'session.type': 'memory',
'session.cookie_expires': 300,
'session.auto': True
}
app = SessionMiddleware(bottle.app(), session_opts)