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
for D in `find . -mindepth 1 -type d` | |
do | |
ffmpeg -i ${D}/img%05d.jpg -c:v libx264 -vf fps=25 ${D}.mp4 | |
done | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Wallet worth estimator</title> | |
<meta name="description" content="Small snippet of code for estimating worth of your crypto wallet"> | |
<meta name="author" content="Michał Drzał - michal.drzal@gmail.com"> | |
<meta name="version" content="0.1.1"> | |
<script> | |
var portfolio = (function() { | |
function add(currency, amount, usdValue) { |
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
def get_revision(): | |
try: | |
with open('/proc/cpuinfo','r') as f: | |
for line in f: | |
if line.startswith('Revision'): | |
return line.split(":")[1].strip() | |
except: | |
return None | |
# sourced from: http://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/ |
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
<html> | |
<head> | |
<script> | |
function getDictionary() { | |
var wordDictionary = {}; | |
document.getElementById("wordlist").value.trim().split("\n").forEach(line => { | |
var tokens = line.split("\t"); | |
wordDictionary[tokens[0]] = tokens[1]; | |
}); | |
return wordDictionary; |
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.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Security.Cryptography; | |
namespace PasswordGenerator | |
{ | |
class Program | |
{ |
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
Tuple<double, double> LinearLeastSquaresFit(List<Point> points) | |
{ | |
double length = points.Count; | |
double Sx = points.Sum(p=> p.X); | |
double Sy = points.Sum(p => p.Y); | |
double Sxx = points.Sum(p => Math.Pow(p.X,2)); | |
double Sxy = points.Sum(p => p.X * p.Y); | |
var a = (Sxy * length - Sx * Sy) / (Sxx * length - Sx * Sx); | |
var b = (Sxy * Sx - Sy * Sxx) / (Sx * Sx - length * Sxx); |
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
function shuffle(o){ | |
for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); | |
return o; | |
} | |
function cellular1d(width, height, density, rule) { | |
var blackPixelsCount = Math.floor(width*density), whitePixelsCount = width - blackPixelsCount; | |
var initial = []; | |
while(blackPixelsCount--) { |
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.Data; | |
using System.Data.OleDb; | |
using System.IO; | |
namespace Importers | |
{ | |
public class DBFImporter | |
{ | |
public static DataTable ExtractDataTable(string filePath) | |
{ |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Diffusion-Limited aggregation</title> | |
<meta name="description" content="Diffusion-Limited aggregation"> | |
<meta name="author" content="Michal Drzal"> | |
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet"> | |
<script src="dla.js"></script> | |
</head> |
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 sys | |
from skimage import io, color | |
from scipy.ndimage.measurements import label, sum | |
from skimage.morphology import convex_hull_image | |
def main(): | |
if len(sys.argv) < 4: | |
print("Input format: <filename> <minimum size of detected shape in pixels> <threshold between 0 and 1>") | |
return |
NewerOlder