Skip to content

Instantly share code, notes, and snippets.

View janne-s's full-sized avatar

Janne Särkelä janne-s

View GitHub Profile
@janne-s
janne-s / scrape-website-to-ics.php
Created July 12, 2013 14:26
PHP Script to scrape a website, find certain content and export the found content as vCalendar .ics file for download and subscription. Employs PHP Simple HTML DOM Parser by S.C. Chen, http://simplehtmldom.sourceforge.net/ A great tool to find the right regular expressions: http://txt2re.com/
<?php
include('simple_html_dom.php'); // http://simplehtmldom.sourceforge.net/
$paivays = '(\d+\.\d+\.\d+)'; // date
$aika = '(\d+:\d+)'; // time
$html = file_get_html('http://www.kava.fi/verkkokauppa/naytosluettelo');
$laskuritaulukko = array(); // array for the number of shows per day
@janne-s
janne-s / EEGLog example with OSC add-on
Last active December 23, 2023 23:26
Emotiv EPOC Java EEGLog raw eeg data to OSC for Max/MSP / Processing etc. The code is set to send OSC data at the address /eegraw to port 6969.
// Build from the Java example project according the instructions: EmotivResearch/docs/Examples/Java/EEGLog
// OSC functionality: https://github.com/hoijui/JavaOSC
import com.sun.jna.Pointer;
import com.sun.jna.ptr.IntByReference;
import com.illposed.osc.*;
import java.net.InetAddress;
import java.util.List;
import java.util.ArrayList;