Skip to content

Instantly share code, notes, and snippets.

@mduleone
mduleone / `PUT` to save
Created February 22, 2017 15:55
Groups breaking
Request:
curl 'https://services.grovo.net/gump-gating/enterprises/36347802-70a7-437d-992c-bf6d828abed1/groups/3c3805da-28b5-4d93-ab0d-132d272a1025' -X PUT -H 'Pragma: no-cache' -H 'Origin: http://mduleone-playpen.local.net:1110' -H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Accept-Language: en-US,en;q=0.8' -H 'authorization: Bearer 568de477d5bcb400010000016037d0b002cc43654eef34d764203c1a' -H 'content-type: application/vnd.api+json' -H 'accept: application/json' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36' -H 'Cache-Control: no-cache' -H 'Referer: http://mduleone-playpen.local.net:1110/admin/groups/3c3805da-28b5-4d93-ab0d-132d272a1025/edit' -H 'Connection: keep-alive' --data-binary $'{"data":{"id":"3c3805da-28b5-4d93-ab0d-132d272a1025","type":"groups","attributes":{"name":"Walter\'s Favorites","status":"active","description":"","enterpriseId":"36347802-70a7-437d-992c-bf6d828abed1","criteriaMatch":"any","criteria":[
@mduleone
mduleone / keybase.md
Created February 6, 2017 22:18
keybase.md

Keybase proof

I hereby claim:

  • I am mduleone on github.
  • I am mduleone (https://keybase.io/mduleone) on keybase.
  • I have a public key whose fingerprint is 326C A771 816F 9230 C1A4 561D 90EF F242 B12C 4C9D

To claim this, I am signing this object:

function intentHandler (session, other, stuff, callback) {
// some random stuff...
request.post({options: "duh",}, {body: "duh",}, function (e0, r0, b0) {
// Now you know that post has returned, do the get stuff you needed
request.get({otherOptions: "duh",}, function (e1, r1, b1) {
// Now you know that get has returned, do the stuff you need.
callback(
sessionAttributes,
buildSpeechletResponseCard(
cardTitle,
@mduleone
mduleone / 054.cbl
Last active January 20, 2017 06:44
COBOL Solution to Project Euler #54
IDENTIFICATION DIVISION.
PROGRAM-ID. euler054.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT POKER-HANDS
ASSIGN TO "./poker.txt"
ORGANIZATION IS LINE SEQUENTIAL
STATUS IS FILE-STATUS.
Verifying "STYLISH CSS"...
ACTUAL EXPECTED
------ --------
"p {" != "Cannot GET /main.css"
" color: #f00;" != ""
"}" != null
"" != null
# FAIL
@mduleone
mduleone / update.php
Last active August 29, 2015 14:04
Original update query
$updQuery = "UPDATE currentQueue SET ";
if (isset($_GET["arrive"]) && $_GET["arrive"] != "") {
$updQuery .= "arrive=" . $arrive;
}
if (isset($_GET["depart"]) && $_GET["depart"] != "") {
if (isset($_GET["arrive"]) && $_GET["arrive"] != "") {
$updQuery .= ", ";
}
$updQuery .= "depart=" . $depart;
}
<?php
$db_params = new stdClass();
$db_params->host = "localhost";
$db_params->user = "Matt";
$db_params->pass = "";
$db_params->database = "parks";
$db_params->query = "SELECT * FROM currentQueue ORDER BY arrive ASC";
$db = mysqli_init();
//function MyCtrl($scope){
// $scope.clock = {
// now: new Date()
// };
// var updateClock = function() {
// $scope.clock.now = new Date();
// };
// setInterval(function(){ $scope.$apply(updateClock);}, 1000);
// updateClock();
//};
<!doctype html>
<html ng-app='myApp'>
<head>
<!--script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.2.2/angular.js'></script -->
<script src='../angular.js'></script>
</head>
<body>
<!--div ng-controller="MyCtrl">
<!-- input ng-model='name' type='text' placeholder='Your Name' -->
<div ng-controller='myController'>
var CENTER = [16384, 16384];
var CENTERX = CENTER[0];
var CENTERY = CENTER[1];
var mult = 84;
var DELTA = [[ 2 * mult, 0 * mult],
[ 1 * mult, -2 * mult],
[-1 * mult, -2 * mult],
[-2 * mult, 0 * mult],
[-1 * mult, 2 * mult],
[ 1 * mult, 2 * mult]];