Skip to content

Instantly share code, notes, and snippets.

View benaubin's full-sized avatar

Ben Aubin benaubin

View GitHub Profile

Keybase proof

I hereby claim:

  • I am penne12 on github.
  • I am penne (https://keybase.io/penne) on keybase.
  • I have a public key whose fingerprint is F388 F64C EDFB 1A4E 5858 EBDF B659 E9A8 F31B D679

To claim this, I am signing this object:

@benaubin
benaubin / swagger.json
Created May 12, 2015 17:59
PlanHWDocs
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "PlanHW",
"description": "#### PlanHW is your new planner - And it's the planner YOU make\nPlanHW has an awesome API that lets you focus on making an awesome planner, and not reinventing the wheel. It's pretty cool, and allows you to make planners that inigrate seemlessly [online](http://planhw.com).\n",
"termsOfService": "http://planhw.com/tos",
"contact": {
"name": "Ben (from BenSites.com)",
"email": "[email protected]",
5000000 times
user system total real
With if, Symbol 1.710000 0.010000 1.720000 ( 1.717787)
With if, Array Size 2 0.730000 0.000000 0.730000 ( 0.733222)
With if, Array Size 3 0.740000 0.000000 0.740000 ( 0.737046)
With if, Array Size 4 0.740000 0.000000 0.740000 ( 0.747544)
With if, Array Size 5 0.740000 0.010000 0.750000 ( 0.746374)
Without if, Symbol 1.500000 0.000000 1.500000 ( 1.514637)
Without if, Array Size 2 0.830000 0.010000 0.840000 ( 0.834003)
Without if, Array Size 3 0.830000 0.000000 0.830000 ( 0.834955)

Syntax

All target selectors start with @. The following character is the selector type. For example, @p means 'closest player'.

Target selectors may have additional, optional arguments. You can specify these in [ ], using the syntax a=0. For example, @p[a=0,b=5,c=-500].

There is a special short syntax for just specifying x, y, z and r arguments; simply list their values separated by a comma, without x=. For example: @p[100,64,-100,5] for 5 range, x=100, y=64 and z=-100. Each of these are optional and skippable by leaving them empty. For example, to just specify y coordinate: @p[,64].

Global Arguments:

(Case sensitive)

  • x - X coordinate for search center. Default is senders coordinate, or 0.
@benaubin
benaubin / codesample.js
Last active March 28, 2016 02:10
A nice way of making javascript in `<code>` blocks editable.
function addScript(src,callback){
var s = document.createElement('script');
s.setAttribute('src', src);
s.onload = callback;
document.body.appendChild(s);
}
function addStyles(){
var s = document.createElement('style');
s.innerText = "\
span.result.error {\
@benaubin
benaubin / word.rb
Last active February 15, 2016 22:25 — forked from lpar/pwgen.rb
Simple generation of readable random made-up words using Ruby
#!/usr/bin/env ruby
# encoding: UTF-8
# Simple word gen in Ruby.
#
# Example:
#
# gen
# gen 10
# gen 7, "prefix-"
moment::firstDayOfMonth = -> @date 1
moment::nextDay = (day) -> @add 1,'d' while @day() != day; @
moment::firstDay = (day) -> @firstDayOfMonth.nextDay day
moment::allDaysRemainingInMonth = ->
t = @clone()
while t.month() == m || m = t.month()
day = t.clone()
@benaubin
benaubin / mysql-god.rb
Last active March 6, 2016 04:40 — forked from traviskroberts/mysql.rb
a nice way of auto restarting mysql
# run in non-daemonized mode (so you can monitor it) with `god -c /path/to/mysql.god -D`
# run normally with `god -c /path/to/mysql.god`
God.watch do |w|
# you can name this whatever you want
w.name = "mySQL"
# polling interval
w.interval = 30.seconds
@benaubin
benaubin / spy.js
Last active April 28, 2016 22:38
spy.js - Need to watch calls to your functions? Or calls to THEIR functions? Spy on them.
(function () {
(function () {
var Spy;
Spy = function () {
function Spy(original, callback1) {
var s;
this.original = original;
this.callback = callback1;
s = this;
this.callback || (this.callback = function (_this) {
@benaubin
benaubin / Readme.md
Last active May 6, 2024 01:45
Click To Call Bookmarklet

Click to Call Bookmarklet

This bookmarklet calls the phone number in the next element clicked. If a phone number does not exist or is not valid, the user is then prompted to enter a valid phone number. This continues until the user enters a valid phone number, or cancels a prompt.

To install the bookmarklet, type this into your browser's address bar (note the javascript: part):

javascript:var%20script=document.createElement('script');script.src="https://cdn.rawgit.com/penne12/246dc4ca0d4db595fcfb07fd441ab513/raw/e2d6e480556d54f305c1619b177568dc488fc376/install-bookmarklet.js";script.type="text/javascript";document.body.appendChild(script);