Skip to content

Instantly share code, notes, and snippets.

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": "hello@PlanHW.com",
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 / 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-"
@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 / 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 / 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 / index.html
Last active November 3, 2016 02:11
Hide a secret
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex, nofollow">
(function(){
var homepage = {
aboutUsLink: jQuery("a[href*='/about']").css({'background-color': 'red'})[0].href
};
if(homepage.aboutUsLink){
var aboutUsPage = jQuery('<iframe>').attr('src', homepage.aboutUs).css({'visibility': 'hidden'}).appendTo('body');
aboutUsPage[0].contentWindow.jQuery((function(){}).bind(aboutUsPage[0].contentWindow))
}
var hoaxHash = {homepage: homepage, aboutUsPage: aboutUsPage};
return hoaxHash;