This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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__': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// 1. Wildcard Pattern | |
func wildcard(a: String?) -> Bool { | |
guard case _? = a else { return false } | |
for case _? in [a] { | |
return true | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.border-radius (@radius) { | |
-webkit-border-radius: @radius; | |
-o-border-radius: @radius; | |
-moz-border-radius: @radius; | |
-ms-border-radius: @radius; | |
border-radius: @radius; | |
} | |
.user-list { | |
// need to use special `.` syntax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# nodejs - Startup script for node.js server | |
# chkconfig: 35 85 15 | |
# description: node is an event-based web server. | |
# processname: node | |
# server: /path/to/your/node/file.js | |
# pidfile: /var/run/nodejs.pid | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby1.9.1 | |
# | |
# Testing multipart uploads into s3 | |
# Very basic script for testing how the functionality works | |
# | |
# Takes a file, splits it up | |
# For each part get the base64 encoded md5 of the part | |
# Then run through the parts and upload them | |
# Refs: |
NewerOlder