Skip to content

Instantly share code, notes, and snippets.

Kurt Roberts kurtroberts

Block or report user

Report or block kurtroberts

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
@kurtroberts
kurtroberts / elk-zentral.txt
Created Jun 20, 2018 — forked from jbaker10/elk-zentral.txt
Setup ELK stack in Zentral
View elk-zentral.txt
## To install Kibana
sudo docker pull sebp/elk:latest
## To run the link on your localhost just to test
docker run --link zentral_elastic_1:elasticsearch -p 127.0.0.1:5601:5601 --net zentral_default kibana
## After this, you should be able to access the Kibana dashboard from 127.0.0.1:5601
## Edit the base.json under conf/start/zentral/base.json
vi ./conf/start/zentral/base.json
@kurtroberts
kurtroberts / userscript.js
Last active Jun 5, 2018
Are you also sick of getting video ads about Wordpress from Lynda.com in your Linked In Feed?
View userscript.js
// ==UserScript==
// @name Brutally remove Lynda updates from linkedin
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Because srsly, what have I ever done to deserve bombardment by wordpress ads?
// @author You
// @match https://www.linkedin.com/feed/
// @grant none
// ==/UserScript==
@kurtroberts
kurtroberts / console
Created Jun 2, 2018
Srsly Adobe?!?!?!?!
View console
$ ps aux | grep dobe
root 45838 0.0 0.0 4332424 576 ?? Ss 17May18 0:00.26 /Library/PrivilegedHelperTools/com.adobe.ARMDC.SMJobBlessHelper
root 45837 0.0 0.0 4331920 588 ?? Ss 17May18 0:00.16 /Library/PrivilegedHelperTools/com.adobe.ARMDC.Communicator
hyxf 32829 0.0 0.1 4981964 7072 ?? S 4May18 0:14.98 /Applications/Utilities/Adobe Creative Cloud/CCLibrary/CCLibrary.app/Contents/MacOS/../libs/node /Applications/Utilities/Adobe Creative Cloud/CCLibrary/CCLibrary.app/Contents/MacOS/../js/server.js
hyxf 32749 0.0 0.1 5019532 8556 ?? S 4May18 0:37.82 /Applications/Utilities/Adobe Creative Cloud/CCXProcess/CCXProcess.app/Contents/MacOS/../libs/node /Applications/Utilities/Adobe Creative Cloud/CCXProcess/CCXProcess.app/Contents/MacOS/../js/main.js
hyxf 640 0.0 0.4 5250672 36188 ?? S 25Apr18 3:03.46 /Library/Application Support/Adobe/Adobe Desktop Common/HEX/Adobe CEF Helper.app/Content
@kurtroberts
kurtroberts / index.js
Created Jan 24, 2018
The end of PERL slang in JS
View index.js
//JSHint brought my attention to the fact that some PERLisms are just not cool in JS anymore...
//This is cool with JSHint:
console.time('if1');
for (var i = 0; i < 100000; i++) {
if(1) { //nice and safe, and don't even THINK of skipping those {}s, even though you don't need them either...
console.log(1 + 1);
}
}
console.timeEnd('if1');
@kurtroberts
kurtroberts / index.php
Created Jan 22, 2018
PHP code to cause @dakhran to sigh in despair.
View index.php
<?php
//if your permissions are set insecurely, he can't prove you did it either!
echo "Let's do this!!!";
ob_start();
echo "exec('rm index.php');";
eval(ob_get_clean());
@kurtroberts
kurtroberts / gist:316b6cf89442d4fd3b7c7467e884a7af
Last active Jan 10, 2018
More fun with PHP's lack of type safety...
View gist:316b6cf89442d4fd3b7c7467e884a7af
$ php -a
php > echo ('' == (string)$some ? 1 : 0);
1
php > echo ('' == $some ? 1 : 0);
1
php > echo ('' === $some ? 1 : 0);
0
php > echo ('' === (string)$some ? 1 : 0);
1
@kurtroberts
kurtroberts / index.js
Created Nov 12, 2017
One-stop understanding of Promises...
View index.js
//TL;DR - Read the MDN page and skip all the tutorials:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
//ES6
var x = new Promise((resolve, reject) => {
setTimeout(function () { resolve('test'); }, 5000);
});
x.then((msg) => console.log(msg));
View keybase.md

Keybase proof

I hereby claim:

  • I am kurtroberts on github.
  • I am kurtroberts (https://keybase.io/kurtroberts) on keybase.
  • I have a public key ASA70wmzqCJjoErdlX8kpu7lj9CdWPXYcWL_lHdFwa7EIgo

To claim this, I am signing this object:

@kurtroberts
kurtroberts / workDays.js
Created Feb 24, 2016
Fun with Generators
View workDays.js
var getNextDay = function (initialDate) {
initialDate.setDate(initialDate.getDate() + 1);
return initialDate;
},
dayOff = function (day) {
if (day.getDay() == 0 || day.getDay() == 6) {
return true;
}
return false;
@kurtroberts
kurtroberts / integers-in-js.md
Last active Jul 3, 2018
Understanding Integers and Performance in JS
View integers-in-js.md

Understanding Integers and Performance in JS

This is just an interactive node session, not really a code snippet.

But it's pretty instructive.

Implicit Casting

kroberts-macpro:~ kroberts$ node
> 23|0
You can’t perform that action at this time.