Skip to content

Instantly share code, notes, and snippets.

View noplanman's full-sized avatar
😇
Coding for the world

Armando Lüscher noplanman

😇
Coding for the world
View GitHub Profile
<?php
/**
* Usage on CLI: $ php broadcast.php [telegram-chat-id] [message]
*/
require __DIR__ . '/vendor/autoload.php';
use Longman\TelegramBot\Request;
use Longman\TelegramBot\Telegram;
@noplanman
noplanman / gps-update
Created January 17, 2016 12:04
GPS file updater for Sony cameras. Just copy this to the root of your SD card and run it.
#!/usr/bin/perl -w
#
# Script for downloading the most recent GPS Assist Data to a Sony DSC
# Camera with built-in GPS, such as the Sony DSC-HX5V. The script must
# be called with the mount point of a memory card for the camera as
# argument.
#
# See https://github.com/henrikbrixandersen/sony-gps-assist for more
# information.
#
@noplanman
noplanman / build_nginx.sh
Created January 15, 2016 04:03 — forked from MatthewVance/build_nginx.sh
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# make script exit if a simple command fails and
# make script print commands being executed
set -e -x
# names of latest versions of each package
export VERSION_PCRE=pcre-8.38
export VERSION_OPENSSL=openssl-1.0.2e
export VERSION_NGINX=nginx-1.9.9
@noplanman
noplanman / PHPUnit.sublime-build
Created October 27, 2015 05:40
Sublime build system for PHPUnit. Either copy this file directly to your Sublime user folder or create a new build system (Tools->Build System->New Build System...).
{
"shell_cmd": "while [ ! -f phpunit.xml.dist ] && [ ! -f phpunit.xml ]; do if [[ `pwd` != '/' ]]; then cd ..; else echo 'No phpunit test config found.'; exit 0; fi; done; phpunit;"
}
@noplanman
noplanman / project-euler.php
Last active August 29, 2015 14:22
ProjectEuler.net - Solutions in PHP
<?php
/**
* Problem 10 - https://projecteuler.net/problem=10
* Find the sum of all the primes below two million.
*/
function pe10() {
// Remember all found primes in this array.
$primes = array( 1 => 2 );
$prime_count = 1;