Skip to content

Instantly share code, notes, and snippets.

View jasalt's full-sized avatar

Jarkko Saltiola jasalt

View GitHub Profile
require 'haversine'
require 'json'
require 'time'
require 'date'
data = JSON.parse(File.read('LocationHistory.json'))
jyvaskyla = [62.244747, 25.7472184]
away_days = {}
@salcode
salcode / .gitignore
Last active February 19, 2025 22:44
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@zouppen
zouppen / README.md
Last active August 29, 2015 14:15
SMS to IRC gateway using Irssi Proxy and Kannel

SMS to IRC gateway

Everybody! Get the feeling of the 90s! Let the dreams come true!

This is a proof of concept for implementing SMS to IRC gateway using Kannel SMS gateway, Irssi Proxy, and an ordinary mobile stick (in my case Huawei E166).

To send message to IRC, just type the following message and send it to the phone number of the gateway:

@zouppen
zouppen / WordSplitter.hs
Created January 29, 2015 21:50
Splits input at word delimeters and outputs a word per line.
-- |Little tool which splits words while you type. Useful when typing
-- live to espeak, for example: runhaskell WordSplitter | espeak
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Attoparsec as A
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import System.IO
@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active February 20, 2025 09:37
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active April 24, 2025 04:34
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@vtajzich
vtajzich / build.sh
Last active May 21, 2019 07:45
Install & compile script fro ffmpeg on raspberry pi
#!/bin/bash
function install_build_tools {
sudo apt-get install git
sudo apt-get install libasound2-dev
sudo apt-get install build-essential
sudo apt-get install make
sudo apt-get install autoconf
sudo apt-get install libtool
@terjesb
terjesb / deserialize_php.clj
Created July 2, 2013 15:51
deserializing php in clojure - using instaparse and serialized-php-parser
(ns deserialize-php
(:require [instaparse.core :as insta]))
(def serialized-php-parser
(insta/parser
"
<S> = expr
<expr> = (string | integer | double | boolean | null | array)+
<digit> = #'[0-9]'
<number> = negative* (decimal-num | integer-num)
@sloria
sloria / recorder.py
Last active April 12, 2024 11:43
WAV recording functionality using pyaudio
# -*- coding: utf-8 -*-
'''recorder.py
Provides WAV recording functionality via two approaches:
Blocking mode (record for a set duration):
>>> rec = Recorder(channels=2)
>>> with rec.open('blocking.wav', 'wb') as recfile:
... recfile.record(duration=5.0)
Non-blocking mode (start and stop recording):