Skip to content

Instantly share code, notes, and snippets.

View sime's full-sized avatar
🔒
Trezor

Simon Males sime

🔒
Trezor
View GitHub Profile
@sime
sime / README.md
Last active October 21, 2023 21:02
Using the Ruby gem bitpay-sdk with BTCPay Server

Using the Ruby gem bitpay-sdk with BTCPay Server

Background

I haven't done Ruby in 5+ years and this reminder to myself how to kick start the bitpay-sdk gem to work with BTCPay Server.

Is this best practise?

No idea.

@sime
sime / schema.php
Created February 26, 2012 15:01
Possible example of using the CakePHP Schema callback `after` to insert content in the database
<?php
// Possible example of using the CakePHP Schema callback `after`
// to insert content in the database.
// Inspiration: https://github.com/majna/schema
// Copy schema.php to app/Config/Schema
// Run: ./Console/cake schema create
App::uses('ClassRegistry', 'Utility');
class AppSchema extends CakeSchema {
@sime
sime / AppController.php
Created August 27, 2012 21:58
Basic Auth in CakePHP on json request
class AppController extends Controller
{
public $components = array(
'RequestHandler',
'Auth',
);
public function beforeFilter() {
$this->__setupAuth();
@sime
sime / bookmarklet.js
Created August 3, 2021 10:27
Password generator XKCD #936 + BIP #39
(function () {
const DICTIONARY = ['abandon', 'ability', 'able', 'about', 'above', 'absent', 'absorb', 'abstract', 'absurd', 'abuse', 'access', 'accident', 'account', 'accuse', 'achieve', 'acid', 'acoustic', 'acquire', 'across', 'act', 'action', 'actor', 'actress', 'actual', 'adapt', 'add', 'addict', 'address', 'adjust', 'admit', 'adult', 'advance', 'advice', 'aerobic', 'affair', 'afford', 'afraid', 'again', 'age', 'agent', 'agree', 'ahead', 'aim', 'air', 'airport', 'aisle', 'alarm', 'album', 'alcohol', 'alert', 'alien', 'all', 'alley', 'allow', 'almost', 'alone', 'alpha', 'already', 'also', 'alter', 'always', 'amateur', 'amazing', 'among', 'amount', 'amused', 'analyst', 'anchor', 'ancient', 'anger', 'angle', 'angry', 'animal', 'ankle', 'announce', 'annual', 'another', 'answer', 'antenna', 'antique', 'anxiety', 'any', 'apart', 'apology', 'appear', 'apple', 'approve', 'april', 'arch', 'arctic', 'area', 'arena', 'argue', 'arm', 'armed', 'armor', 'army', 'around', 'arrange', 'arrest', 'arrive', 'arrow', 'art', '
https://play.google.com/store/apps/details?id=net.namstudio.android.tool.fillmemory.free
@sime
sime / hanlder.js
Created May 25, 2017 09:16
TechTalk: Serverless Framework, 24 May 2015
'use strict';
module.exports.hello = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'Go Serverless v1.0! Your function executed successfully!',
input: event,
}),
};
@sime
sime / ang-209-multipolygon.patch
Created April 21, 2016 13:52
Patch for Angular Google Maps 2.0.9 MultiPolygon patch
--- angular-google-maps.js 2016-04-21 15:48:38.000000000 +0200
+++ angular-google-maps-2.0.9.custom.js 2016-04-21 15:43:34.000000000 +0200
@@ -2,7 +2,6 @@
* AngularJS directives for Google Maps
* git: https://github.com/angular-ui/angular-google-maps.git
*/
-
/*
!
The MIT License
@sime
sime / angular-google-maps-2.0.9.custom.js
Created April 21, 2016 13:30
MultiPolygon support in Angular Google Maps 2.0.9
/*! angular-google-maps 2.0.9 2014-11-18
* AngularJS directives for Google Maps
* git: https://github.com/angular-ui/angular-google-maps.git
*/
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
@sime
sime / tinkerbox_intern_rails_app.md
Last active December 30, 2015 22:09
A Rails app to get your hands dirty quickly

Message board

A message board application where people can contribute to various topics.

At each step, the application must be deployed on Heroku

Create a message (thread).

Anyone can post a message. A new message requires the following fields

  • subject
@sime
sime / gist:7641790
Created November 25, 2013 14:14
storing photos from camera
if (window.resolveLocalFileSystemURI) {
console.log('Attemping to resolveFileSystemURI of ' + imageData);
window.resolveLocalFileSystemURI(
imageData,
function(fileEntry) {
console.log('requesting file system');
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs) {
console.log('moving file');
fs.root.getDirectory('bob', {create: true}, function(dirEntry) {
var fileName = moment().valueOf().toString() + '.jpg';