Skip to content

Instantly share code, notes, and snippets.

@phyous
phyous / entities_api.json
Last active December 10, 2015 21:58
entities api
{
"id":"Barack Obama\tPERSON",
"description":"Barack Obama",
"image":null,
"type":"entity",
"children":[
{
"relationshipName":"tweetedBy",
"values":[
{
@phyous
phyous / wpa_supplicant.conf
Created December 16, 2012 00:46
proper config for raspberry pi File: /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="__SSID__"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="__PASSWORD__"
@phyous
phyous / interfaces
Created December 16, 2012 00:42
proper config for raspberry pi File: /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
@phyous
phyous / notifications.sh
Created December 15, 2012 08:54
A bash function that uses the pushover api(https://pushover.net/) to send push notifications to your phone.
############################
# Push notifications script
############################
read -d '' String <<"EOF"
require "net/https"
require "socket"
url = URI.parse("https://api.pushover.net/1/messages.json")
req = Net::HTTP::Post.new(url.path)
@phyous
phyous / CountSubs.java
Created October 5, 2012 16:11
Algorithm to find # of occurrences of a substring in a given input string
/* Problem: Find # of occurrences of a substring in a given input string
Example Output:
Test string: abcdabceabcfabcabcd
Substring count for abc:5
Substring count for abcd:2
*/
public class CountSubs {
public static void main(String[] args) {
String testString = "abcdabceabcfabcabcd";