Skip to content

Instantly share code, notes, and snippets.

using System;
using System.IO;
using System.Net;
using System.Text;
using System.Collections.Generic;
public class SSEvent {
public string Name { get; set; }
public string Data { get; set; }
FFMPEG '-i', file, '-c:v', 'libopenjpeg', "jpeg2000\\" + name + ".jp2"\
Convert image to jpeg2000
ffmpeg -i in.png -c:v libopenjpeg out.jp2
Hex Edit out.jp2
ffmpeg -i in.jp2 -c:v png out.png
General Edit
ffmpeg -i input.avi -c:v mpeg2video -g 999 -q:v 1 output.avi
*edit in avidemux/whatever*
@chrishamant
chrishamant / nginx.conf
Created September 5, 2018 14:03 — forked from kmjones1979/nginx.conf
Example NGINX configuration to route based on country code using GeoIP
# load dynamic modules
load_module /etc/nginx/modules/ngx_http_geoip_module.so;
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events { worker_connections 1024; }
http {
#import necessary libraries
import cv2
import numpy as np
#capture video from the webcam
cap = cv2.VideoCapture(0)
#load the face finder
face_cascade = cv2.CascadeClassifier('/home/sm/Desktop/haarcascade_frontalface_default.xml')
@chrishamant
chrishamant / main.py
Created February 26, 2016 07:16 — forked from fogleman/main.py
Collision Avoidance
from collections import deque
from math import sin, cos, pi, atan2, hypot
import random
import time
import wx
SIZE = 600
COUNT = 64
SPEED = 100
FOLLOWERS = 4
@chrishamant
chrishamant / dragon.py
Created February 26, 2016 07:13 — forked from fogleman/dragon.py
Dragon Curve with Turtle Graphics (Python)
import turtle
def turn(i):
left = (((i & -i) << 1) & i) != 0
return 'L' if left else 'R'
def curve(iteration):
return ''.join([turn(i + 1) for i in range(2 ** iteration - 1)])
if __name__ == '__main__':
@chrishamant
chrishamant / pattern-examples.swift
Created October 27, 2015 19:15 — forked from terhechte/pattern-examples.swift
Swift pattern examples for the swift, for, and guard keywords
import Foundation
// 1. Wildcard Pattern
func wildcard(a: String?) -> Bool {
guard case _? = a else { return false }
for case _? in [a] {
return true
}
@chrishamant
chrishamant / index.html
Last active August 29, 2015 14:24
A silly game
<script>
function init(){
var gameLength = 15000 // 15 seconds
var s = 0 // Number of clicks
var t = Date.now() //start time (in seconds since 1970)
var elm = document.getElementById("gamePiece")
elm.onclick = function(){

Keybase proof

I hereby claim:

  • I am chrishamant on github.
  • I am chrishamant (https://keybase.io/chrishamant) on keybase.
  • I have a public key whose fingerprint is A19A D2E8 F799 9300 2BBC 1F30 DD81 7C70 E634 361B

To claim this, I am signing this object:

module.exports = {
format: 'json',
apiVersion: '2013-11-04',
endpointPrefix: 'kinesis',
jsonVersion: '1.1',
serviceFullName: 'Amazon Kinesis',
signatureVersion: 'v4',
targetPrefix: 'Kinesis_20131104',
timestampFormat: 'iso8601',
operations: {