Skip to content

Instantly share code, notes, and snippets.

@PaulBGD
PaulBGD / noadblock.js
Created June 20, 2015 03:49
Check if someone is using adblock
setTimeout(function() {
var adsbygoogle = document.getElementsByClassName('adsbygoogle');
if (adsbygoogle && adsbygoogle.length > 0 && adsbygoogle[0].childNodes.length == 0) {
console.log('Please turn off adblock!');
}
}, 1000);
import lombok.Data;
import org.apache.commons.lang3.Validate;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
/**
* @author PaulBGD
*/
@PaulBGD
PaulBGD / gist:4a637a871b8e0a67e967
Created July 16, 2015 04:42
Put this in your address bar to head to Chester's Skype
Chester is currently too busy to handle your request. Check out this dedicated Skype room!
skype:?chat&blob=DwqHBv-h_KtVeIuYMHt_7265uibJE7tUv9v2q_VIafmSxI7kJye06V0pk4qQxzo-ZXDDWkEF3A
(function() {
var letters = letters = {
'A': [
[, 1],
[1, , 1],
[1, , 1],
[1, 1, 1],
[1, , 1]
],
'B': [
@PaulBGD
PaulBGD / README.md
Last active September 27, 2015 00:27
CaaS README

CaaS - Chester as a Service

Pricing

Limit pricing

This pricing is for raising the rate limit to the main chester brain.

  • $2.50/month - rate limit is raised to 5,000 questions per hour
  • $5.00/month - rate limit is raised to 10,000 questions per hour
@PaulBGD
PaulBGD / raven.d.ts
Last active October 10, 2015 19:11
Raven bindings for typescript
declare module "raven" {
export interface RavenClient {
patchGlobal():void;
captureMessage(message:any):void;
captureMessage(message:any, args:MessageArguments):void;
captureMessage(message:any, callback:(result:Result) => void):void;
captureMessage(message:any, args:MessageArguments, callback:(result:Result) => void):void;
captureError(message:any):void;
captureError(message:any, args:MessageArguments):void;
@PaulBGD
PaulBGD / lint.js
Last active November 11, 2015 12:59
TypeScript linter
var configuration = {
rules: {
'variable-name': true,
'comment-format': [true, 'check-space'],
'curly': true,
'eofline': true,
'forin': true,
'indent': [true, 'spaces'],
'jsdoc-format': true,
'no-switch-case-fall-through': true,
@PaulBGD
PaulBGD / Hologram.java
Last active December 3, 2016 18:16
No dependency 1.8+ holograms and item holograms
package net.burngames.decorations.utils;
import lombok.Getter;
import org.bukkit.Location;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
/**
* @author PaulBGD
updateSelector() {
if (this.running) {
return this.selector.style.display = 'none';
}
let lines = this.lines;
let length = this.input.value.length;
if (!this.running) {
length += this.prefix.length;
}
length -= this.input.value.length - this.input.selectionStart;
@PaulBGD
PaulBGD / artisan-validator.d.ts
Last active December 5, 2015 23:15
Artisan Validator TypeScript Definition + Example
/// <reference path="../bluebird/bluebird.d.ts" />
declare module ArtisanValidator {
class Validator<R> {
try(checking: any, rules: R): Promise<ValidatorResult<R>>;
validators: ArtisanValidator.Validators;
}
interface ValidatorResult<R> {