Skip to content

Instantly share code, notes, and snippets.

@kogcyc
kogcyc / curlPOSTdigest.sh
Created October 4, 2013 19:10
how to POST to a DIGEST authenticated url
curl --digest -u admin:pass http://localhost/~matt/exampleDIGEST.php --data "stff=hello"
@kogcyc
kogcyc / gist:6910945
Created October 10, 2013 00:22
How the CSS display: none/block attribute works
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type='text/javascript' src='//code.jquery.com/jquery-1.9.1.js'></script>
<style type='text/css'>
body {
margin: auto;
@kogcyc
kogcyc / sqlite_cheatsheet
Created October 16, 2013 16:42
sqlite cheatsheet (OK, it's just the output from .help, but I think it has value...)
sqlite> .help
.backup ?DB? FILE Backup DB (default "main") to FILE
.bail ON|OFF Stop after hitting an error. Default OFF
.databases List names and files of attached databases
.dump ?TABLE? ... Dump the database in an SQL text format
If TABLE specified, only dump tables matching
LIKE pattern TABLE.
.echo ON|OFF Turn command echo on or off
.exit Exit this program
//povray sprocket.pov -w960 -h540 +a0.9
//povray sprocket.pov -w2732 -h1536 +a0.9
camera {
right 16/9*x
location <1,1,-1>*150
look_at <-4,23,0>
angle 10
//location <1,1,-1>*650
//look_at <0,0,0>
@kogcyc
kogcyc / circ.svg
Created June 12, 2016 14:06
another circle svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kogcyc
kogcyc / chainstar.color.study.svg
Created June 12, 2016 18:29
Kogswell chainstar color study
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kogcyc
kogcyc / simple_scene.pov
Created December 21, 2016 14:39
simple POVRAY scene
camera {location <1,1,-1>*50 look_at <0,0,0>}
light_source {<1,1,1>*100 rgb <1,1,1>*1}
#declare count = 4;
#while (count > 0)
sphere {<count*10,0,0> 5 pigment {rgb <1,1,1>*0+(0.3*count)}}
@kogcyc
kogcyc / povray_logo.inc
Last active January 3, 2017 00:13
The original Chris Colefax POV-Ray logo
merge {
sphere {2*y, 1 pigment {rgb<0.1,1,0>}}
difference {
cone {2*y, 1, -4*y, 0}
sphere {2*y, 1.4 scale <1,1,2>}
pigment {rgb<1,0.1,0>}
}
difference {
sphere {0, 1 scale <2.6, 2.2, 1>}
sphere {0, 1 scale <2.3, 1.8, 2> translate <-0.35, 0, 0>}
@kogcyc
kogcyc / heroku_linux_distribution.bash
Last active January 8, 2017 20:39
how to find the distribution on which your Heroku app is running
user@host:~$ heroku run cat /etc/*-release --app app_name
Running cat /etc/lsb-release /etc/os-release on ⬢ app_name... up, run.1971 (Free)
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
NAME="Ubuntu"
VERSION="14.04.5 LTS, Trusty Tahr"
ID=ubuntu
@kogcyc
kogcyc / simple_jinja2.py
Created March 13, 2017 00:53
simple jinja2
from jinja2 import Template
t = Template("Hello {{ something }}!")
t.render(something="World")