Skip to content

Instantly share code, notes, and snippets.

@kyledrake
kyledrake / ferengi-plan.txt
Last active Jul 12, 2021
How to throttle the FCC to dial up modem speeds on your website using Nginx
View ferengi-plan.txt
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@Plastix
Plastix / name_checker.php
Created Dec 30, 2013
PHP script used for checking the availability of Minecraft usernames. Requires a text file called names.txt in the same directory as the script with one name per line. Available names are saved to available_names.txt.
View name_checker.php
<?php
// Checks the availability of Minecraft usernames given a text file of names
$names = Array();
$input = "./names.txt"; //Names to be checked (one per line)
$output= "./available_names.txt"; //Available names
$names = file($input, FILE_IGNORE_NEW_LINES);
if(file_exists($output)) file_put_contents($output, "");
foreach( $names as $name ) {
anonymous
anonymous / night-before-opsmas.txt
Created Dec 24, 2013
Twas the night before Opsmas..
View night-before-opsmas.txt
'Twas the night before Christmas, when all through the racks
Not a server was alerting, not even Compaqs.
The backups were written to tapes with care
In hopes that later the data would be there.
The machines were nestled all snug in their sleds
Whilst visions of vengeance danced in their heads;
And oncall in his three-wolf and I in my rack.
Had just settled down for some syn and some ack.
View patch-edid.rb
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@aadnk
aadnk / Attributes.java
Last active Sep 15, 2020
Edit attributes in 1.6.2 (Not dependent on ProtocolLib). See https://github.com/aadnk/AttributeStorage/tree/nms for 1.7.2.
View Attributes.java
package com.comphenix.example;
import java.lang.reflect.Field;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ConcurrentMap;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@Dinnerbone
Dinnerbone / gist:5631634
Last active May 14, 2020
New chat system for Minecraft. The server won't translate any text for the client, and there'll be a proper stack based colouring/formatting system, so no more leaking colours, english-only messages, or out of date translations.
View gist:5631634
{
"color": "yellow",
"translate": "multiplayer.player.joined",
"using": [
"Dinnerbone"
]
}
{
"color": "gray",
@tonybruess
tonybruess / Bukkit Entity Spawning.md
Last active Nov 27, 2017
Bukkit Entity Spawning
View Bukkit Entity Spawning.md

Entities that work:

  • Arrow
  • Bat
  • Blaze
  • Boat bow charge has no effect, always spawns on player head
  • CaveSpider
  • Chicken
  • Cow
  • Creeper
  • Egg
@csexton
csexton / deploy.rb
Created Jan 10, 2013
Capistrano Recipe to skip asset compilation if nothing has changed
View deploy.rb
namespace :deploy do
namespace :assets do
def should_update_assets
from = source.next_revision(current_revision)
capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
rescue
true
end
task :precompile, :roles => :web, :except => { :no_release => true } do
@geuis
geuis / remote-typeahead.js
Created Feb 16, 2012
Remote data querying for Twitter Bootstrap 2.0 Typeahead without modifications
View remote-typeahead.js
<script>
// Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful
// Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it.
// The following will allow remote autocompletes *without* modifying any officially released core code.
// If others find ways to improve this, please share.
var autocomplete = $('#searchinput').typeahead()
.on('keyup', function(ev){
ev.stopPropagation();
@philBrown
philBrown / ImageManipulator.php
Created Mar 22, 2011
Image manipulation class, provides cropping, resampling and canvas resize
View ImageManipulator.php
<?php
class ImageManipulator
{
/**
* @var int
*/
protected $width;
/**
* @var int