Skip to content

Instantly share code, notes, and snippets.

View nrbrd's full-sized avatar

aron nrbrd

View GitHub Profile
@nrbrd
nrbrd / codeini.py
Created June 15, 2015 02:49
CodeInput bug with IniLexer
from kivy.uix.codeinput import CodeInput
from kivy.lang import Builder
from kivy.app import App
from pygments.lexers.configs import IniLexer
class MainApp(App):
def build(self):
return CodeInput(lexer=IniLexer())
@nrbrd
nrbrd / fish.sh
Last active August 29, 2015 14:23
fish.config
function fish_prompt
if test -z $WINDOW
printf '{%s%s%s at %s%s%s%s%s%s%s}$ ' (set_color "#FFFF00") (whoami) (set_color "#00FF00") (set_color "#FFFF00") (hostname|cut -d . -f 1) (set_color $fish_color_cwd) (prompt_pwd)(set_color "#FFFF00") (__fish_git_prompt) (set_color normal)
else
printf '{%s%s%s at %s%s%s(%s)%s%s%s%s}$ ' (set_color "#FFFF00") (whoami) (set_color "#00FF00") (set_color "#FFFF00") (hostname|cut -d . -f 1) (set_color $fish_color_cwd) (echo $WINDOW) (prompt_pwd)(set_color "#FFFF00") (__fish_git_prompt) (set_color normal)
#printf '%s%s at %s%s%s(%s)%s%s%s$ ' (set_color white) (whoami) (set_color purple) (hostname|cut -d . -f 1) (set_color white) (echo $WINDOW) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
end
end
function fish_greeting
@nrbrd
nrbrd / listable.py
Last active August 29, 2015 14:22
Selectable Kivy-garden RecycleView experiment
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.behaviors import CompoundSelectionBehavior
from kivy.uix.relativelayout import RelativeLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.app import App
from recycleview import RecycleView
from kivy.properties import ObjectProperty
@nrbrd
nrbrd / customaction.py
Created May 28, 2015 22:40
Get ActionGroup from ActionButton - Kivy
class CustomActionView(ActionView):
def get_group(self, item):
'''Get the ActionGroup of a item
'''
for group in self._list_action_group:
if item in group.list_action_item:
return group
return None
@nrbrd
nrbrd / SentimentMallet.java
Created May 4, 2015 00:21
Sentiment NLP with Mallet
package com.aronbordin;
import ca.uwo.csd.ai.nlp.kernel.LinearKernel;
import ca.uwo.csd.ai.nlp.mallet.libsvm.SVMClassifierTrainer;
import cc.mallet.classify.*;
import cc.mallet.pipe.*;
import cc.mallet.pipe.iterator.CsvIterator;
import cc.mallet.types.Instance;
import cc.mallet.types.InstanceList;
import cc.mallet.util.Randoms;
__version__ = '1.0'
from kivy.app import App
from kivy.uix.label import Label
from plyer import uniqueid
class TestAndroidID(App):
def build(self):
return Label(text=str(uniqueid.id))
@nrbrd
nrbrd / AppActivity.java
Created April 17, 2015 17:18
AppActivity.java for Cocos2d-js and Google Play Services
/****************************************************************************
Copyright (c) 2008-2010 Ricardo Quesada
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2011 Zynga Inc.
Copyright (c) 2013-2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@nrbrd
nrbrd / led letter list.ino
Created February 12, 2015 13:22
Example on how to show a list of letters with LED matrix on Arduino
#include "TimerObject.h"
#include "LedMatrixObject.h"
TimerObject *timer = new TimerObject(1000); //change letter each second
LedMatrixObject *led = new LedMatrixObject(2, 3, 4, 5, 6, 7, 8, 9);
int letterId = 0; //you can set a number to represent each leter. You check this number on loop()
int letterList[] = {0, 4, 2, 10}; //list of letters in order
#include "TimerObject.h"
TimerObject *timer1 = new TimerObject(1000); //use two hours here
TimerObject *timer2 = new TimerObject(1000); //use 6 hours
TimerObject *timer3 = new TimerObject(1000); //two minutes
void setup() {
Serial.begin(9600);
@nrbrd
nrbrd / hello.ino
Created January 28, 2015 14:08
16x16 Dot LED Matrix Display Arduino Hello World
/**
*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the