Skip to content

Instantly share code, notes, and snippets.

@stylesuxx
stylesuxx / x4convert.sh
Last active August 29, 2015 13:57
Convert the faulty avi files that the X4 quadrocopter saves on the remote
#!/bin/bash
#
# Convert the (broken) avi files saved by the hubsan x4 H107D remote.
#
# This gstreamer pipeline reindexes the avi file, crops the broken parts of the
# image to the right and left and fixes the aspect ratio. The new files are
# saved into the 'fixed' folder.
#
# <chris@1337.af>
@stylesuxx
stylesuxx / trick.c
Created September 30, 2014 20:27
gst trick player
#include <stdio.h>
#include <stdlib.h>
#include <gst/gst.h>
typedef struct _AppElements {
GMainLoop *loop;
GstElement *pipeline;
GstElement *source;
GstElement *demuxer;
GstElement *convert;
#include <stdio.h>
#include <stdlib.h>
#include <gst/gst.h>
typedef struct _AppElements {
GMainLoop *loop;
GstElement *pipeline;
GstElement *source;
GstElement *demuxer;
GstElement *convert;
#######################################################################################################################
#
# Purpose: Bash script to fix a few elements of the default Dokku script with running correctly on Debian Wheezy
# Run as root
# Author: Shirkey <dev@shirkey.me>
# License: MIT
# Tested with:
# * Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux
# * v0.2.1 of Dokku installer script
#
@stylesuxx
stylesuxx / jhr.js
Created October 4, 2013 18:11 — forked from Zirak/jhr.js
//this is a tiny helper method for making JSON Http Requests
//if you want a more comprehensive solution, write it yourself
//
//the callback function will receive two arguments: the response,
// parsed as JSON, and the xhr object used inside jhr, with an added
// responseJSON property (you can probably guess what it is)
//
//this always sends a POST request, and the data is always serialized to JSON
//
//returns the xhr object used
# Place in the folder where all the libdrc dependencies are.
#
# Remove the mac80211 module and load the patched one
# For this to work we need to first unload all the wifi modules, load
# the patched mac80211 stack and then load back the wifi modules.
# After this hostappd and netboot are started. One can connect to both of them via sudo screen.
WLAN=wlan1 # Interface Name
BSSID=34:af:2c:4d:a7:65 # BSSID of the WiiU pad
DOMAIN=AT # The regulatory domain for WiFi
example.blif: example.v
yosys -p 'synth_ice40 -blif example.blif' example.v
example.txt: example.blif example.pcf
arachne-pnr -d 8k -p example.pcf -o example.txt example.blif
example.bin: example.txt
icepack example.txt example.bin
example_sram: icoprog example.bin
# Only comment out the IO's you are using in your code
#set_io clk R9
#set_io led1 C8
#set_io led2 F7
#set_io led3 K9
#set_io btn1 K11
#set_io btn2 P13
module top (input btn1, output led1);
always @(btn1) led1 = btn1;
endmodule
module top (input btn1, output led1);
initial begin
led1 = 0;
end
always @(posedge btn1) begin
led1 = !led1;
end
endmodule