Skip to content

Instantly share code, notes, and snippets.

View paukul's full-sized avatar

Pascal Friederich paukul

View GitHub Profile
@paukul
paukul / gcm-high-prio.sh
Created November 21, 2017 23:47 — forked from sebastianbenz/gcm-high-prio.sh
Send high priority GCM messages via curl (Android Doze mode & App Standby testing)
curl -X POST \
-H "Authorization: key= YOUR-API-KEY" \
-H "Content-Type: application/json" \
-d '{
"registration_ids": [
"YOUR-GCM-REGISTRATION-ID"
],
"data": {
"message": "Hello Message"
},
/*
Basic Arduino example for K-Series sensor
Created by Jason Berger
Co2meter.com
Rewritten for WiFi-functionality of an ESP8266
and connected to a Senseair S8 CO2-sensor
20151116: Added Philips Hue functionality
by Markus Ulsass
*/
@paukul
paukul / worker.go
Last active August 29, 2015 14:15
simple queue manager
D: {{device_1 apn [HSV CL] asdf} 1 f4bac0f8-9d4e-4a4b-4c94-066661982203}
D: {{device_1 apn [HSV CL] asdf} 1 12f9cbac-e5dd-47ea-5e67-840bb4378945}
R: {{device_1 apn [HSV CL] asdf} 3 6ea977d4-ec97-4653-5d3f-6aedd6407f91}
D: {{device_1 apn [HSV CL] asdf} 1 abdaa11e-0274-4c2b-6dcd-9d41eb303f3c}
R: {{device_1 apn [HSV CL] asdf} 2 7e3e2a04-6f0a-434c-6488-b6c4f21ac2d6}
R: {{device_1 apn [HSV CL] asdf} 2 e8d629eb-541f-4a00-50aa-4ffd473c129f}
R: {{device_1 apn [HSV CL] asdf} 2 1e1273fb-94bd-4d30-417d-587a0d800a6c}
D: {{device_1 apn [HSV CL] asdf} 1 41669839-e220-43f9-4e7b-7178ef41dc76}
D: {{device_1 apn [HSV CL] asdf} 1 57201b63-a648-4327-6608-f9015fc2e52a}
R: {{device_1 apn [HSV CL] asdf} 2 ca1ac428-86f2-413c-52cf-8059b16e6883}
# lib/monkey/cancan/controller_resource.rb
module CanCan
class ControllerResource
protected
def strong_parameters?
@params.class.name == 'ActionController::Parameters'
end
@paukul
paukul / em_gateway.rb
Created June 21, 2012 16:11
eventmachine based apns push service implementation
require 'eventmachine'
module PushService::Gateways::Apns
class EMGateway
include PushService::Logging
class NotConnected < PushService::Error; end
def initialize
@error_callback = nil
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
install_git "ruby-1.9.2-p290-railsexpress" "https://github.com/paukul/matzruby.git" "ruby192pl290railsexpress" autoconf standard
@paukul
paukul / 1.8.7-p352-railsexpress
Created October 4, 2011 16:24
ruby-build definition for skaes ruby 1.8.7-p352
use_gcc42_on_lion
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
install_git "ruby-1.8.7-p352-railsexpress" "https://github.com/skaes/matzruby.git" "ruby187pl352railsexpress" autoconf standard
install_package "rubygems-1.3.7" "http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz" ruby
@paukul
paukul / query_builder_helper.rb
Created September 26, 2011 12:25
solr query sanitizer using a statemachine (like a baws!)
# the only dependencies are http://rubygems.org/gems/transitions
# and I think active support
module Search
module QueryBuilderHelper
def sanitize_field_for_solr_query(query)
if query.is_a?(Hash)
query.inject({}) do |result, query_component|
result[query_component.first] = query_component.first == '*' ? query_component.last : QueryField.sanitize(query_component.last)
result
tell application "Skype"
send command "SET USERSTATUS DND" script name "pomodoro"
end tell
tell application "Mail" to quit
tell application "Tweetie" to quit
@paukul
paukul / paralell_runner.rb
Created December 26, 2010 08:52
hydra, deeptest and others were a little heavyweight for my needs
ENV['RAILS_ENV'] = "test"
require 'test/unit/testsuite'
require 'test/unit/collector/objectspace'
require 'test/unit/ui/testrunnermediator'
require 'test/unit/ui/console/testrunner'
require 'test/unit/testresult'
require 'config/environment'
require 'drb'
no_workers = 4