Skip to content

Instantly share code, notes, and snippets.

View rburgosnavas's full-sized avatar

rburgosnavas rburgosnavas

  • Swiftly, Inc.
  • Concord, CA
View GitHub Profile
@rburgosnavas
rburgosnavas / eq.c
Created June 16, 2017 17:53
Simple 3-band EQ
//---------------------------------------------------------------------------
//
// 3 Band EQ :)
//
// EQ.H - Header file for 3 band EQ
//
// (c) Neil C / Etanza Systems / 2K6
//
// Shouts / Loves / Moans = etanza at lycos dot co dot uk
//
@rburgosnavas
rburgosnavas / Skal.java
Last active August 29, 2015 14:12
A simple Toast helper class for Android.
import android.content.Context;
import android.widget.Toast;
/**
* Helper class to make Toasts with.
*/
public class Skal {
/**
* Creates a Toast.
@rburgosnavas
rburgosnavas / AndroidManifest.xml
Last active August 29, 2015 14:11
Sync Adapter
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rburgosnavas.droidfs" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.READ_SYNC_STATS"/>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
package com.vuzz.snapdish.ui;
import android.content.Context;
import android.support.v7.internal.view.SupportMenuInflater;
import android.support.v7.internal.view.menu.MenuBuilder;
import android.support.v7.internal.view.menu.MenuPopupHelper;
import android.support.v7.internal.view.menu.MenuPresenter;
import android.support.v7.internal.view.menu.SubMenuBuilder;
import android.view.Menu;
import android.view.MenuInflater;
/**
* Testing Jackson with Groovy
**/
import org.codehaus.jackson.map.*
// sample JSON
json = """{
"name": {
"first": "Morgoth",
"last": "Melkor"
@rburgosnavas
rburgosnavas / hfold.hs
Last active August 29, 2015 13:57
folds
-- this
foldr (\x xs -> (x * 10):xs) [] $ foldr (\x xs -> if x `mod` 2 == 0 then x:xs else xs) [] $ foldr (\x xs -> if x > 3 then x:xs else xs) [] [5,9,8,3,6,7,1,5,2]
-- that
[x * 10 | x <- [5,9,8,3,6,7,1,5,2], x > 3, x `mod` 2 == 0]
-- or
foldr (\x xs -> (x * 10):xs) [] $ filter (\x -> x `mod` 2 == 0) $ filter (> 3) [5,9,8,3,6,7,1,5,2]
@rburgosnavas
rburgosnavas / rec.scala
Created August 7, 2013 00:12
This is to practice tail recursion by creating a method that splits text after 80 characters long and adds the next line over. split80(...) works but it is not tail recursive. newSplit80(...) attempts that.
/**
* Recursive split text to lines of 80 characters
*/
def split80(text: String): String = {
if (text.length <= 80) {
text
} else {
text.substring(0, 80) + "\n" + split80(text.substring(80))
}
}