Skip to content

Instantly share code, notes, and snippets.

View gist:e4d184599de177f8a57539df59ae0889
Verifying that +dereckson is my blockchain ID. https://onename.com/dereckson
@dereckson
dereckson / app.js
Created Mar 20, 2017
Code to parse a JSON document, decorate with relevant links and print a server log
View app.js
"use strict";
/* -------------------------------------------------------------
Nasqueron infrastructure
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Project: Nasqueron
Author: Sébastien Santoro aka Dereckson
Dependencies: jQuery
Filename: app.js
Licence: CC-BY 4.0, MIT, BSD-2-Clause (multi-licensing)
@dereckson
dereckson / product.php
Created Mar 19, 2018
How to perform 14 * 10^-15?
View product.php
<?php
use Brick\Math\BigDecimal;
require 'vendor/autoload.php';
$left = BigDecimal::of(14);
$right = BigDecimal::one()->toScale(15)->dividedBy(BigDecimal::ten()->power(15));
$product = $left->multipliedBy($right);
@dereckson
dereckson / app.rs
Created Sep 5, 2018
Example to run a Rocket server to serve some routes through Limiting Factor.
View app.rs
use limiting_factor::kernel::DefaultApplication;
use requests::*;
pub fn run () {
let routes = routes![
status,
favicon,
users::register,
users::get_player,
];
@dereckson
dereckson / salt.patch
Last active Nov 1, 2019
Allow cmd.* to work on FreeBSD with runas
View salt.patch
--- modules/cmdmod.py.old 2019-10-30 13:41:23.087222000 +0000
+++ modules/cmdmod.py 2019-10-30 20:00:37.064300000 +0000
@@ -67,9 +67,7 @@
# Set up logging
log = logging.getLogger(__name__)
-DEFAULT_SHELL = salt.grains.extra.shell()['shell']
-
# Overwriting the cmd python module makes debugging modules with pdb a bit
@dereckson
dereckson / step1.js
Last active Oct 1, 2020
Regenerate DockerHubBuildTriggers.json
View step1.js
triggers = {};
(function () {
var s = document.createElement('script');
s.setAttribute('src', 'https://code.jquery.com/jquery-3.5.1.min.js');
document.body.appendChild(s);
}());
// Pause as we need jQuery object to be available, and so we need to let time to the browser to load the script