Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View FSX's full-sized avatar
💭
I may be slow to respond.

Frank FSX

💭
I may be slow to respond.
View GitHub Profile
@FSX
FSX / script.lua
Last active December 21, 2023 15:34 — forked from chanks/script.lua
Lua script to delete/trim all processed messages from a Redis stream
-- The goal of this script is to trim messages that have been processed by
-- all extant groups from the a given Redis stream. It returns the number
-- of messages that were deleted from the stream, if any. I make no
-- guarantees about its performance, particularly if the stream is large
-- and not fully processed (so a simple XTRIM isn't possible).
-- First off, bail out early if the stream doesn't exist.
if redis.call("EXISTS", KEYS[1]) == 0 then
return false
end
set defaultencoding=utf-8
set accelerated-compositing=true
set input-autohide=true
set spell-checking=false
set statusbar=true
set webinspector=trueset
set dns-prefetching=true
set insecure-content-show=true
set insecure-content-run=true
set html5-database=true
@FSX
FSX / async_psycopg2.py
Created March 8, 2011 22:11
A module for asynchronous PostgreSQL queries in Tornado.
#!/usr/bin/env python
__author__ = 'Frank Smit <frank@61924.nl>'
__version__ = '0.1.0'
import functools
import psycopg2
from tornado.ioloop import IOLoop, PeriodicCallback
@FSX
FSX / randwp.py
Created October 22, 2010 21:08
Grabs a random wallpaper from the wallbase.net toplist.
#!/usr/bin/env python
"""
randwp
~~~~~~
Fetches random wallpapers from the wallbase.net toplist and sets it as the
background.
This script needs Python 3.*. Windows people need to install the `pywin32`_
and Mac OS X people need to install `py-appscript`_.
@FSX
FSX / about.md
Last active May 10, 2020 08:22 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer

Programming Achievements: How to Level Up as a Developer

  1. Select a particular experience to pursue.
  2. Pursue that experience to completion. (Achievement unlocked!)
  3. Reflect on that experience. Really soak it in. Maybe a blog post would be in order?
  4. Return to Step 1, this time selecting a new experience.

*This gist is a fork of the gist from [this blog post][1] and this [Gist][2].

Keybase proof

I hereby claim:

  • I am fsx on github.
  • I am fsx (https://keybase.io/fsx) on keybase.
  • I have a public key ASAIRr_qNsll5vg1oD-4-wJltY-utn8HXHLv8MM1yU879go

To claim this, I am signing this object:

@FSX
FSX / tornado_thread_pool.py
Created May 2, 2012 16:02
A simple thread pool for Tornado.
#!/usr/bin/env python
# Thread pool based on: http://code.activestate.com/recipes/577187-python-thread-pool/
from queue import Queue
from threading import Thread
from functools import partial
import tornado.httpserver
import tornado.ioloop
import tornado.options
howl.config.indent = 4
howl.mode.by_name('python').config.indent = 4
howl.mode.by_name('golang').config.tab_indents = true
howl.bindings.push {
editor = {
ctrl_a = 'cursor-home',
ctrl_e = 'cursor-line-end',
ctrl_shift_a = 'cursor-home-extend',
ctrl_shift_e = 'cursor-line-end-extend',
! special
*.foreground: #c5c8c6
*.background: #0f0d0d
*.cursorColor: #c5c8c6
! black
*.color0: #282a2e
*.color8: #373b41
! red
@FSX
FSX / README.md
Last active December 20, 2015 11:39
Simple IRC bot in Go.

Installation

$ mkdir Go && cd Go
$ mkdir -p {bin,pkg,src,src/pikabot,src/pikachu}
# Put content of pikachu.go in src/pikachu
# Put content of pikabot.go in src/pikabot and edit pikabot.go
$ go install pikabot
$ ./bin/pikabot