Skip to content

Instantly share code, notes, and snippets.

View natronics's full-sized avatar
💭
Not currenly working on side projects.

Nathan Bergey natronics

💭
Not currenly working on side projects.
View GitHub Profile
@natronics
natronics / expected.sql
Created July 8, 2021 13:52
Django Annotate F Expression Zeros
SELECT
0 AS "zero_sum",
(0 + COUNT("pizza"."id"))
FROM "pizza"
zero_sum | complex_sum
--------- | -----------
0 | 100
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@natronics
natronics / slitscan.sh
Created June 12, 2015 05:45
Oneliner to make a video slitscan
#!/usr/bin/env sh
ffmpeg -i $1 -vf "transpose=1","crop=2" -an -f image2pipe -vcodec ppm - | montage ppm:- -tile x1 -mode concatenate - | convert - -flop scanimage.jpg
@natronics
natronics / log.html
Last active November 7, 2015 20:54
turn weechat logs into html
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="natronics.org">
<meta name="author" content="Nathan Bergey">
<link href='http://fonts.googleapis.com/css?family=Arvo:400,700|PT+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
<link href="/resources/css/bootstrap.min.css" rel="stylesheet">
<link href="/resources/css/style.css" rel="stylesheet">
@natronics
natronics / zenirc
Created March 5, 2014 20:01
An /etc/init.d/ start-stop-daemon for managing https://github.com/zenirc/zenircbot
#!/bin/sh
### BEGIN INIT INFO
# Provides: zenirc
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts zenircbot
# Description: Starts zenircbot
@natronics
natronics / app.py
Last active January 3, 2016 15:29
Simple button on a webpage. Bootstrap for style.
#!/usr/bin/env python
from flask import Flask, render_template, url_for, redirect, request
import os
tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), './')
app = Flask(__name__, template_folder=tmpl_dir)
@app.route("/", methods=['GET', 'POST'])
def index():
@natronics
natronics / wifi-packet-speed.ipynb
Created December 18, 2013 07:39
Quick WiFi packets per second calculation for different speeds
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@natronics
natronics / git-prompt.sh
Last active December 21, 2015 06:29
My simple version of a bash prompt that shows current git info.
## git status in prompt
find_git_status() {
local c_red='\[\e[31m\]'
local c_green='\[\e[32m\]'
local c_clear='\[\e[0m\]'
ps1pc_start="$1"
ps1pc_end="$2"
@natronics
natronics / iss-speed.ipynb
Last active December 21, 2015 01:19
How far does the space station go in....
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@natronics
natronics / Theoretical_Rocket.ork
Last active December 20, 2015 14:39
Liquid Rocket back of the envelope