Skip to content

Instantly share code, notes, and snippets.

View splittingred's full-sized avatar
💭
🚀

Shaun McCormick splittingred

💭
🚀
View GitHub Profile
@splittingred
splittingred / Jobs.proto
Created July 25, 2017 15:30
gruf-bp-proto
syntax = "proto3";
package demo;
service Jobs {
rpc GetJob(GetJobReq) returns (GetJobResp) { }
}
message GetJobReq {
uint64 id = 1;
@splittingred
splittingred / response.xml
Created February 1, 2016 15:35
enom-response.xml
<?xml version="1.0" encoding="utf-8"?>
<interface-response>
<CertGetApproverEMail>
<Success>False</Success>
</CertGetApproverEMail>
<Command>CERTGETAPPROVEREMAIL</Command>
<APIType>API</APIType>
<Language>eng</Language>
<ErrCount>1</ErrCount>
<errors>
@splittingred
splittingred / gist:606c6b6b07c8e536dcd7
Last active February 28, 2018 19:37
Things Nick Hates
Things Nick Hates
0) Ann Kitchen
1) non-shallow tests
2) `if !`
3) ants
4) rock stars
5) sunlight off porch windows when drinking coffee
6) people who feed the meter
7) using floats for money

Keybase proof

I hereby claim:

  • I am splittingred on github.
  • I am splittingred (https://keybase.io/splittingred) on keybase.
  • I have a public key whose fingerprint is DDFF 7D05 78C7 C3BD B1B9 45C5 6D10 B616 3AD3 FC69

To claim this, I am signing this object:

@splittingred
splittingred / normalized_word_frequency.rb
Last active December 14, 2015 05:29
Finds a normalized ranking of word frequency given an article of text
##
# Finds a normalized ranking of word frequency given an article of text
#
class Hash
##
# Normalize the array to values between 0 and 1
#
# @param [Boolean] weight_lower_value Set to true to give more weight to lower values
#
def normalize(weight_lower_value = false)
@splittingred
splittingred / gist:4689218
Last active April 30, 2019 09:39
Example of modRest, a REST Client, in MODX 2.3.
$config = array(
'baseUrl' => rtrim('http://mywebsite.com/rest/api/','/'),
'format' => 'json', // json or xml, the format to request
'suppressSuffix' => false, // if false, will append .json or .xml to the URI requested
'username' => 'myuser', // if set, will use cURL auth to authenticate user
'password' => 'mypass',
'curlOptions' => array(
'timeout' => 30, // cURL timeout
'otherCurlOption' => 1,
@splittingred
splittingred / transport.menu.php
Created April 20, 2012 18:45 — forked from BobRay/transport.menu.php
MODX menu transport file (for MODX 2.3)
/* will route to the first found of the following:
[namespace-path]controllers/[manager-theme]/index.class.php
[namespace-path]controllers/default/index.class.php
[namespace-path]controllers/index.class.php
*/
$menu= $modx->newObject('modMenu');
$menu->fromArray(array(
'text' => 'mycomponent',
'parent' => 'components',
'description' => 'mycomponent.menu_desc',
@splittingred
splittingred / gist:2353708
Created April 10, 2012 19:03
twitter search criteria for #modx hashtag
modx -2by2host -from:modx -from:modx_feeds -to:modx -from:wehatejbieber -modx_ch -mr_modx -/logs/modx -noon_modx lang:en
@splittingred
splittingred / .htaccess
Created April 9, 2012 21:48
Example of how to use new REST server class in MODX 2.3+
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ rest/index.php?_rest=$1 [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ rest/index.php [QSA,NC,L]
</IfModule>
@splittingred
splittingred / simple-benchmark.php
Created March 9, 2012 05:37
simple-benchmark.php
<?php
set_time_limit(0);
class Timer {
public $timer = 0;
public function start() {
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$this->timer = $mtime;