Skip to content

Instantly share code, notes, and snippets.

Selby Kendrick selbyk

Block or report user

Report or block selbyk

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
@selbyk
selbyk / first_run.log
Last active Sep 18, 2018
Lutris LoL Failure
View first_run.log
wine: cannot find L"C:\\windows\\system32\\winemenubuilder.exe"
LeagueClient.exe(00000009): ALWAYS| Application Version:8.18.245.4647 - CL:2454647 - Build Date:Sep 12 2018 - Build Time:23:38:23
@selbyk
selbyk / get-npm-package-version
Created Sep 20, 2017 — forked from DarrenN/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
View get-npm-package-version
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@selbyk
selbyk / gist:9fec0e69e50f38e02ebd40792fb87cb6
Created Jan 18, 2017
log all node.js http/https requests
View gist:9fec0e69e50f38e02ebd40792fb87cb6
let reqCount = 0;
function requestLogger(httpModule) {
var original = httpModule.request;
httpModule.request = function(options, callback) {
console.log(reqCount++, options.method, options.href || options.proto + "://" + options.host + options.path);
console.log(options.uri);
console.log(options.headers);
return original(options, callback);
}
View rabbitmq.conf
[
{rabbit, [
{tcp_listeners, [{"::", 5672}]}
]}
].
@selbyk
selbyk / digit-sums.js
Created Jun 29, 2016
Find the amount of numbers between two positive integers whose digits sum equals another given positive integer
View digit-sums.js
/**
* Find the amount of numbers between 10 and 1000 whose digits sum equals 9
*/
// lodash gives us lots of useful magic functions for arrays, objects, etc
const _ = require('lodash');
// set up our variables
let start = 10, end = 1000;
let digitTotal = 9;
@selbyk
selbyk / rand_hex.sh
Last active Jun 8, 2016
Generate random hex
View rand_hex.sh
#!/bin/bash
length=12
if [[ $1 =~ ^[0-9]+$ ]]; then
length=$1
fi
cat /dev/urandom | tr -dc 'a-fA-F0-9' | fold -w $length | head -n 1
View gist:290db67bb014530698171b683a40a674
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIt2/zMbtwdBsdWPH7obrfPk2GH/k9S5KcQbBzIqi8rTbelwFdpViD59cRUltq+KybP3NwPZN87Aazc59C2u6T+1vRq4sonAVEIpYAGmI+lnImb9VGiMqMh3YYgBfMcV3i7/HMR6SuDs1ZrVd3P8fv/ioZ5zd7QI67YxzrCgcDx7V2LBT0YN/OX/bMTImplHMdw4ykJmNaov8PuhLqa4jXfxXEI8izQVCt+bWfjunQbF1flquPqZMfp+iutw6Ol35kWDJYmEiQUrc2DFsrPLqsblfwnGLUDp3+u+KGXfapaDGgZehJ7cxT9+p4AB9FvEA+r5TgAcQUDYH1CVPBxogd selby@daenerys.local
View change_timezone.sh
#/bin/bash
# timedatectl set-timezone America/Chicago
sudo timedatectl set-timezone America/Los_Angeles
@selbyk
selbyk / compile-nginx.sh
Last active Apr 14, 2016
Compile nginx for HTTP/2, bash script for compressing static files, and a config
View compile-nginx.sh
#!/bin/bash
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_gzip_static_module \
--with-pcre=../pcre-8.38 \
--with-zlib=../zlib-1.2.8
View ember component
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'audio',
attributeBindings: ['src', 'preload'],
src: Ember.computed.alias('url'),
preload: 'none',
didInsertElement() {
let _this = this;
audiojs.events.ready(function() {
You can’t perform that action at this time.