Skip to content

Instantly share code, notes, and snippets.

@alexcmd
alexcmd / libjitsi_bundle_streams.java
Created September 13, 2016 16:52 — forked from Haerezis/libjitsi_bundle_streams.java
An example to show how to bundle RTP streams with ice4j and libjitsi
LibJitsi.start();
MediaService mediaService = LibJitsi.getMediaService();
//I assume that I have a working video and audio MediaDevice
MediaDevice randomVideoDevice = createVideoDevice();
MediaDevice randomAudioDevice = createAudioDevice();
//I create the MediaFormat for each stream
MediaFormat videoFormat
@alexcmd
alexcmd / MeshSplinesAndExtrusion.cs
Created September 18, 2016 17:01 — forked from unitycoder/MeshSplinesAndExtrusion.cs
Snippets : Unite 2015 - A coder's guide to spline-based procedural geometry
/* Code snippets from Unite 2015 - A coder's guide to spline-based procedural geometry */
/* https://www.youtube.com/watch?v=o9RK6O2kOKo */
// Optimized GetPoint
Vector3 GetPoint( Vector3[] pts, float t ) {
float omt = 1f-t;
float omt2 = omt * omt;
float t2 = t * t;
return pts[0] * ( omt2 * omt ) +
pts[1] * ( 3f * omt2 * t ) +
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=JSS15J
ro.build.display.id=JSS15J.I9505XXUEML1
ro.build.version.incremental=I9505XXUEML1
ro.build.version.sdk=18
ro.build.version.codename=REL
ro.build.version.release=4.3
ro.build.date=Tue Dec 10 14:28:08 KST 2013
ro.build.date.utc=1386653288
@alexcmd
alexcmd / gist:837f8069cb86c6bb6fccb291bc5172b2
Created January 31, 2017 06:55 — forked from lucasferreira/gist:1135780
Get image data in Javascript
//from: http://stackoverflow.com/questions/934012/get-image-data-in-javascript
function getBase64Image(img) {
// Create an empty canvas element
var canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
// Copy the image contents to the canvas
var ctx = canvas.getContext("2d");

View installed PPA Repository with a .sh script

#! /bin/sh 
# listppa Script to get all the PPA installed on a system ready to share for reininstall
for APT in `find /etc/apt/ -name \*.list`; do
    grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do
        USER=`echo $ENTRY | cut -d/ -f4`
        PPA=`echo $ENTRY | cut -d/ -f5`
 echo sudo apt-add-repository ppa:$USER/$PPA
@alexcmd
alexcmd / min-char-rnn.py
Created April 21, 2017 16:28 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@alexcmd
alexcmd / latency.txt
Created May 9, 2017 13:21 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@alexcmd
alexcmd / container_handmade.go
Last active June 24, 2017 21:35 — forked from julz/main.go
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@alexcmd
alexcmd / readme.md
Created July 12, 2017 21:00 — forked from baraldilorenzo/readme.md
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@alexcmd
alexcmd / gist:7f202ba07394ccba1bba30fae99eb199
Last active August 19, 2017 18:59 — forked from ebuildy/gist:5d4ad0998848eaefdad8
Setup sentry logger on a fresh Ubuntu server
sudo apt-get update
sudo apt-get install python-virtualenv
sudo apt-get install python-dev
sudo apt-get install postgresql
sudo apt-get install postgresql-server-dev-9.3
sudo apt-get install redis-server
sudo -u postgres createuser -s sentry
sudo -u postgres psql -c "alter user sentry with password 'sentry';"