Skip to content

Instantly share code, notes, and snippets.

💭
🚀

Shaun McCormick splittingred

💭
🚀
Block or report user

Report or block splittingred

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Jobs.proto
syntax = "proto3";
package demo;
service Jobs {
rpc GetJob(GetJobReq) returns (GetJobResp) { }
}
message GetJobReq {
uint64 id = 1;
View 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>
View gist:606c6b6b07c8e536dcd7
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
View keybase.md

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 Dec 14, 2015
Finds a normalized ranking of word frequency given an article of text
View normalized_word_frequency.rb
##
# 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 Apr 30, 2019
Example of modRest, a REST Client, in MODX 2.3.
View gist:4689218
$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 Apr 20, 2012 — forked from BobRay/transport.menu.php
MODX menu transport file (for MODX 2.3)
View transport.menu.php
/* 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 Apr 10, 2012
twitter search criteria for #modx hashtag
View gist:2353708
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 Apr 9, 2012
Example of how to use new REST server class in MODX 2.3+
View .htaccess
<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>
View 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;
You can’t perform that action at this time.