Skip to content

Instantly share code, notes, and snippets.

var face_cropper = (function(){
var crop_faces = function(rects, sc, max, imageObj, imageType){
var on = rects.length;
if(on && max)
{
jsfeat.math.qsort(rects, 0, on-1, function(a,b){return (b.confidence<a.confidence);})
}
var n = max || on;
n = Math.min(n, on);
@jamesejr
jamesejr / ms12-020.rb
Created August 24, 2013 23:16
MS12-020 Remote Desktop Protocol (RDP) Remote Code Execution PoC (Ruby)
#!/usr/bin/env ruby
#
# ms12-020 PoC attempt
#
# NOTE: This was crafted based on a legit connection packet capture and reversing
# a packet capture of the leaked MAPP PoC.
#
# by Joshua J. Drake (jduck)
#
@shriphani
shriphani / convert_lfw_siamese_data.cpp
Last active December 4, 2016 15:12
Caffe LFW Training
//
// This script converts the lfw dataset to the leveldb format used
// by caffe to train siamese network.
// Usage:
// convert_lfw_data input_image_file input_label_file output_db_file
#include <fstream> // NOLINT(readability/streams)
#include <string>
#include "glog/logging.h"
@grigorisg9gr
grigorisg9gr / sample_loading_of_frames_and_landmarks.ipynb
Created June 16, 2017 13:50
This is a sample file accompanying the '1st 3D Face Tracking in-the-wild Competition'. - http://bit.ly/2szZTCb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcoreyes
jcoreyes / readme.md
Last active January 21, 2018 10:41
Image Captioning LSTM
@nwert
nwert / libusb.patch
Last active June 20, 2018 04:34
nxboot
diff --git a/libusb/os/linux_usbfs.h b/libusb/os/linux_usbfs.h
index 2449632..5ef03ba 100644
--- a/libusb/os/linux_usbfs.h
+++ b/libusb/os/linux_usbfs.h
@@ -82,7 +82,7 @@ struct usbfs_iso_packet_desc {
};
#define MAX_BULK_BUFFER_LENGTH 16384
-#define MAX_CTRL_BUFFER_LENGTH 4096
+#define MAX_CTRL_BUFFER_LENGTH 0xFFFF
#coding=utf-8
import os.path as osp
import sys
import copy
import os
from sys import path
import numpy as np
import google.protobuf as pb
@shuffle2
shuffle2 / fuses.c
Created October 17, 2017 23:26
dump + decode tegra t210 ipatches
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#define ARRAYSIZE(x) (sizeof(x) / sizeof(*x))
@andlima
andlima / gist:1774060
Created February 8, 2012 21:34
Median of medians selection algorithm
int find_kth(int *v, int n, int k) {
if (n == 1 && k == 0) return v[0];
int m = (n + 4)/5;
int *medians = new int[m];
for (int i=0; i<m; i++) {
if (5*i + 4 < n) {
int *w = v + 5*i;
for (int j0=0; j0<3; j0++) {
int jmin = j0;
@indiejoseph
indiejoseph / ffmpeg-mjpeg.sh
Created August 23, 2015 15:53
ffmpeg record mjpg-streamer
ffmpeg -f mjpeg -r 5 -i "http://openwrt:openwrt@localhost:8080/?action=stream" -r 5 ./video.avi