Skip to content

Instantly share code, notes, and snippets.

View TehShrike's full-sized avatar
🕺
Groovy.

Josh Duff TehShrike

🕺
Groovy.
View GitHub Profile
@TehShrike
TehShrike / on-one-line.js
Last active September 16, 2017 16:16
Gimme the ASIN
javascript:(function() {
function getFromUrl(url) {
return url.match(RegExp("https?://www.amazon.com/([\\w-]+/)?(dp|gp/product)/(\\w+/)?(\\w{10})"))[4]
}
document.body.innerHTML = '<h1>::asin|' + getFromUrl(Array.prototype.slice.apply(document.getElementsByTagName('link')).filter(function(element) { return element.attributes.getNamedItem('rel').value === 'canonical' })[0].href) + '|Title::</h1>'
})()
@TehShrike
TehShrike / etc init.d autoexec
Created July 11, 2015 20:46
Getting things to run on startup on linux with init.d
#!/bin/sh
### BEGIN INIT INFO
# Provides: autoexec
# Required-Start: $remote_fs $syslog networking procps
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Autoexec Starting
# Description: Enable autoexec
### END INIT INFO
@TehShrike
TehShrike / autoexec.sh
Created July 22, 2015 22:31
psy autoexec.sh
echo "Launching autoexec stuff"
/opt/iojs/bin/node /opt/iojs/bin/psy daemon --pidfile=/opt/autoexec/psy.pid -l /opt/autoexec/psy.log
cd /opt/communal-checklist
/opt/iojs/bin/node /opt/iojs/bin/psy start -n communalchecklist.com --cwd=/opt/communal-checklist --env.PORT=8001 -l communalchecklist.log -- npm run start
nginx
@TehShrike
TehShrike / nginx.conf
Created July 22, 2015 22:33
nginx conf with port forwarding and socket.io
# /etc/nginx/nginx.conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
@TehShrike
TehShrike / angry gm
Created August 14, 2015 13:59
Angry GM fix bookmarklet
javascript:Array.prototype.forEach.call(document.getElementsByTagName('p'), function(elem) {elem.innerText = elem.innerText.replace(/a[!@#$%^&*]{2}/g, 'ass').replace(/f[!@#$%^&*]{3}/g, 'fuck').replace(/s[!@#$%^&*]{3}/g, 'shit')})
@TehShrike
TehShrike / package.json
Created February 2, 2016 03:37
Browserify package.json babelify transform
{
"browserify": {
"transform": [
[
"babelify",
{
"presets": "es2015"
}
]
]
@TehShrike
TehShrike / company-autocomplete.json
Created February 10, 2016 17:15
Autocomplete indexes
{
"mappings": {
"company": {
"properties": {
"companyId": {
"type": "long"
},
"ngramName": {
"type": "string",
"index": "analyzed",
@TehShrike
TehShrike / rollup.config.js
Created February 17, 2016 00:05
rollup.config.js
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import nodeResolve from 'rollup-plugin-node-resolve'
import includePaths from 'rollup-plugin-includepaths'
import string from 'rollup-plugin-string'
export default {
globals: {
querystring: 'querystring',
events: 'events',

I get asked -- often -- if I hate police

I don't; I look at "police" generally like I look at teachers generally

When a teacher decides to rape a student, we don't demonize all teachers. Same w/ teachers who are woefully inept at teaching.

But, at the same time, no sane person denies there are teacher-rapists and teachers who suck at their job

I view police the same; I'm willing to take a leap of faith and assume you're competent, until you prove otherwise

@TehShrike
TehShrike / 2016-06-08-question.md
Created June 8, 2016 15:44
Riddle me this, oh esteemed Mode7

re: http://www.mode7games.com/blog/2016/06/07/i-dont-want-you-to-know-how-our-open-world-works/

Would a "time to kill" indicator in FS be stepping over the line between good-confusion and too-much-accessibility?

If units had a timer bar or a countdown appear over their heads when they engaged, counting down towards the instant where they would kill the enemy vatform, it would make it obvious that engagements were won based on a timer.

Most new FS players seemed to assume kills were determined by constantly rolling dice until one vatform "won" the dice roll. I think they inferred this from the machine gun/shotgun animations that ran during the engagement.

Is this desirable?