Skip to content

Instantly share code, notes, and snippets.

View christianmeichtry's full-sized avatar

Christian Meichtry christianmeichtry

View GitHub Profile
@christianmeichtry
christianmeichtry / config.xml
Last active April 16, 2018 18:09
Display NSLocationWhenInUseUsageDescription modal using Phonegap Build with cordova-plugin-geolocation
<gap:config-file overwrite="true" parent="NSLocationWhenInUseUsageDescription" platform="ios">
<string>Your custom text here</string>
</gap:config-file>
@christianmeichtry
christianmeichtry / modulo10.rb
Last active February 19, 2021 02:59
Calcul du chiffre-clé, modulo 10, récursif BVR Suisse
# Calcul du chiffre-clé, modulo 10, récursif BVR Suisse
# Berechnung der Prüfziffer nach Modulo 10, rekursiv BESR Schweiz
# Calculating the Check Digits Using Module 10, Recursively
def modulo10_checksum(number) # Best to send a string, an integer with leading 0's will be interpreted as octal...
# table from https://www.credit-suisse.com/media/production/pb/docs/unternehmen/kmugrossunternehmen/besr_technische_dokumentation_fr.pdf
table = [
[0,9,4,6,8,2,7,1,3,5],
[9,4,6,8,2,7,1,3,5,0],
# Encoding: utf-8
# IN GEMFILE : gem 'wombat' #does the scraping magic
class WeatherData < ActiveRecord::Base
require 'open-uri'
require 'digest/md5'
attr_accessible :max_wind, :mean_wind, :sea_level_pressure, :station_code, :station_id, :temp, :time_stamp, :wind_direction, :conditions
belongs_to :station
@christianmeichtry
christianmeichtry / mandelbrot_worker.js
Created November 23, 2010 10:09
Mandelbrot Worker
function doYLine(screenX, xMax, yMax)
{
computedLine = new String ;
computedLine = screenX ;
xZoom = xMax/1000.0/.5 ;
yZoom = yMax/1000.0/.5 ;
xThingy = screenX/xMax ;
@christianmeichtry
christianmeichtry / mandelbrot.js
Created November 23, 2010 10:07
Mandelbrot Web Worker
xMax = window.innerWidth ;
yMax = window.innerHeight ;
maxThreads = 6 ;
function workerMessage(thread) {
return '' +thread + ' ' + xMax + " " + yMax ;
}
var b_canvas = document.getElementById("a");
svn remove log/*
svn commit -m 'removing all log files from subversion'
svn propset svn:ignore "*.log" log/
svn update log/
svn commit -m 'Ignoring all files in /log/ ending in .log'
svn remove tmp/*
svn commit -m 'removing all tmp artifacts from subversion'
svn propset svn:ignore "*" tmp/
svn update tmp/
int ledPin = 0 ;
int catPin = 8 ;
int buttonUp = 14 ;
int buttonDown = 15 ;
int number = 0 ;
unsigned long time, oldTime ;
int numbers[10][8]={{HIGH,HIGH,HIGH,HIGH,HIGH,HIGH,LOW,LOW},
@christianmeichtry
christianmeichtry / gist:159974
Created August 2, 2009 07:00
Simple script to report temp and memory to pachube
require 'rubygems'
require 'logger'
gem 'builder'
require 'net/http'
gem 'Floppy-eeml'
require 'eeml'
logger = Logger.new("#{File.dirname(__FILE__)}/pachube.log")
PACHUBE_KEY = #YOUR KEY HERE
digits = /\d+/