Skip to content

Instantly share code, notes, and snippets.

@flk92
flk92 / 0000-nonblock.patch
Created December 28, 2015 09:18
Bluetooth SPP + Edison library patches
diff -uprN a/bt_test_nonblock_read/bt_test_nonblock_read.ino b/bt_test_nonblock_read/bt_test_nonblock_read.ino
--- a/bt_test_nonblock_read/bt_test_nonblock_read.ino 1969-12-31 21:00:00.000000000 -0300
+++ b/bt_test_nonblock_read/bt_test_nonblock_read.ino 2015-12-14 11:32:58.394690200 -0200
@@ -0,0 +1,22 @@
+#include <Wire.h>
+#include <Intel_Edison_BT_SPP.h>
+
+static Intel_Edison_BT_SPP spp = Intel_Edison_BT_SPP();
+
+void setup() {
@flk92
flk92 / noip2
Last active August 29, 2015 13:58
No-IP dynamic DNS updater init script for Debian/Ubuntu
#! /bin/sh
# /etc/init.d/noip2.sh
# Supplied by no-ip.com
# Modified for Debian GNU/Linux by Eivind L. Rygge <eivind@rygge.org>
# corrected 1-17-2004 by Alex Docauer <alex@docauer.net>
# . /etc/rc.d/init.d/functions # uncomment/modify for your killproc
### BEGIN INIT INFO
@flk92
flk92 / dict.c
Last active January 28, 2021 05:08
dict
#include "dict.h"
#include "mem.h"
#include "str.h"
DICT_ELEM* dict_get(
DICT *d,
char *key,
DICT_ELEM *prev) {
unsigned int i;
@flk92
flk92 / list.c
Last active January 1, 2016 01:09
Linked list
#include <stdlib.h>
#include "list.h"
static list_item *create_item(int value);
static void remove_item(list_item *item);
struct list_struct {
list_item *first;
list_item *last;
unsigned int length;
@flk92
flk92 / ..FORTRAN_GIST
Last active January 1, 2016 01:09
Helping out a friend on using Fortran (to the extent I can help)
We couldn’t find that file to show.
@flk92
flk92 / clifx.c
Last active December 30, 2015 13:48
Quick 'n' dirty audible response based on command exit status implemented in C.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <signal.h>
@flk92
flk92 / test.c
Last active December 26, 2015 00:39
Playing with waveforms and WAV
#include <stdio.h>
#include <math.h>
#include <signal.h>
#include <stdint.h>
#include <stdlib.h>
int volatile quit = 0;
void intHandler() {
quit = 1;
@flk92
flk92 / CSVParser.java
Created November 1, 2012 15:44
Simple CSV Parser
import java.util.ArrayList;
import java.util.List;
/**
* @author Fabio Larrea
*/
public class CSVParser {
public static final int SB_CAPACITY = 128;
public static final char CHAR_SEPARATOR = ',';
@flk92
flk92 / Scriptizer.sh
Created May 14, 2012 18:37
Transforms any folder structure to a script
#!/bin/bash
# Scriptizer.sh: transforms any folder structure to a script
# Fabio K
# Add header
echo "#!/bin/bash"
for file in `find .`
do