Skip to content

Instantly share code, notes, and snippets.

View olymk2's full-sized avatar
😀
Using GitLab

Oliver Marks olymk2

😀
Using GitLab
View GitHub Profile
@olymk2
olymk2 / sql-edit-completion.el
Last active February 19, 2024 10:06
Adding completing read to sqlite-mode-extras-edit-row-field
(defun sqlite-mode-extras-completing-read-field (table column)
"Do a grouped select to get some completion candidates"
(delq nil (flatten-tree (sqlite-execute
sqlite--db
(format "SELECT %s FROM %s GROUP BY %s limit 100"
column
table
column)))))
@olymk2
olymk2 / readme.md
Last active November 7, 2023 16:32
Scan solus packages for occurances of a packing in the dependencies

Example of running

bb scan.clj --search nodejs

or use the below command with vscode calva emacs or similar bb nrepl-server

@olymk2
olymk2 / argos_docker.sh
Last active May 17, 2017 14:48
Docker Argos
#!/usr/bin/env bash
echo "Docker"
echo "---"
# http://stackoverflow.com/a/14853319
TOP_OUTPUT=$(docker ps -q | xargs docker inspect --format="http://{{if ne \"\" .NetworkSettings.IPAddress}}{{ printf \"%.22s\" .NetworkSettings.IPAddress}}{{else}}{{range .NetworkSettings.Networks}}{{printf \"%.22s\" .IPAddress}}{{end}}{{end}} {{printf \"%.30s\" .Name}} | href=\"http://{{if ne \"\" .NetworkSettings.IPAddress}}{{ printf \"%.22s\" .NetworkSettings.IPAddress}}{{else}}{{range .NetworkSettings.Networks}}{{printf \"%.22s\" .IPAddress}}{{end}}{{end}}\"" | column -t -s@ -c 80)
echo "$TOP_OUTPUT | font=monospace bash=top useMarkup=true"
#!/usr/bin/python
import os
import sys
import OpenGL
# OpenGL.USE_ACCELERATE = False
# OpenGL.ERROR_CHECKING = False
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL import GL as GL
@olymk2
olymk2 / GLArea.py
Created February 11, 2017 22:03
Example trying to mix GLArea and pyopengl theat currently does not work.
#!/usr/bin/python
import os
import sys
from OpenGL.GLU import *
from OpenGL import GLX
from OpenGL import GL as GL
from ctypes import *
import gi
gi.require_version('Gtk', '3.0')

Keybase proof

I hereby claim:

  • I am olymk2 on github.
  • I am oly (https://keybase.io/oly) on keybase.
  • I have a public key whose fingerprint is 4266 B087 7825 D55E 5D64 36F6 E4AF A068 43DE 8993

To claim this, I am signing this object:

@olymk2
olymk2 / recharge_cycle.ino
Created August 28, 2016 11:35
Current code for laser tag recharge cycle
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int ir_led = 4;
@olymk2
olymk2 / pygame_generator.py
Created June 23, 2016 20:30
example pygame generator
def fetch_tiles(startColumn, endColumn, rows=20):
tilesToDraw = tiles[0:rows, startColumn:endColumn]
for rowCount, row in enumerate(tilesToDraw):
for columnCount, column in enumerate(row):
yield rowCount, columnCount
# Draw the tile array to the screen
def drawScreenTiles(tiles, pixelsScrolled, levelPosition):
startColumn = levelPosition / tileSize
#!/usr/bin/env/python3
# This file is /home/me/test-dbus.py
# Remember to make it executable if you want dbus to launch it
# It works with both Python2 and Python3
from gi.repository import Gtk
import dbus
import dbus.service
from dbus.mainloop.glib import DBusGMainLoop
import os
import Queue
import argparse
import webbrowser
import socket, fcntl, struct
import time, threading
from subprocess import Popen, PIPE
from docker import Client
docker_client = Client(base_url='unix://var/run/docker.sock')