Skip to content

Instantly share code, notes, and snippets.

View dchapman1988's full-sized avatar

David Chapman dchapman1988

View GitHub Profile
@dchapman1988
dchapman1988 / bob_explorer.rb
Last active June 20, 2023 03:31
Fun with blocks, procs and lambdas.
class Adventurer
attr_accessor :name, :location
def initialize(name, location = "Edge of Forest")
@name = name
@location = location
end
def move(&block)
block.call(self)
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
ServerAlias openx.example.com
DocumentRoot /home/deployer/myapp/current/public
PassengerSpawnMethod conservative
RackBaseURI /
RackEnv production
@dchapman1988
dchapman1988 / launcher.rb
Created December 7, 2012 01:48
Just an interface for the USB Dream Cheeky Thunder Rocket Launcher
# Usage:
#
# launcher = Launcher.new
# launcher.up # steps turret up, available commands are: up, down, left, right, stop, fire
# launcher.up 500 # moves turret up for 500ms
#
require "usb"
class Launcher
COMMANDS = {
:up => "\x02\x02\x00\x00\x00\x00\x00\x00",
function UET(o){if(this.stringExists=function(n){return n&&n.length>0},this.domain="bat.bing.com",this.URLLENGTHLIMIT=4096,this.pageLoadEvt="pageLoad",this.customEvt="custom",this.pageViewEvt="page_view",o.Ver=o.Ver!==undefined&&(o.Ver==="1"||o.Ver===1)?1:2,this.uetConfig={},this.uetConfig.consent={enabled:!1,adStorageAllowed:!0,adStorageUpdated:!1,hasWaited:!1,waitForUpdate:0},this.beaconParams={},this.supportsCORS=this.supportsXDR=!1,this.paramValidations={string_currency:{type:"regex",regex:/^[a-zA-Z]{3}$/,error:"{p} value must be ISO standard currency code"},number:{type:"num",digits:3,max:999999999999},integer:{type:"num",digits:0,max:999999999999},hct_los:{type:"num",digits:0,max:30},date:{type:"regex",regex:/^\d{4}-\d{2}-\d{2}$/,error:"{p} value must be in YYYY-MM-DD date format"},"enum":{type:"enum",error:"{p} value must be one of the allowed values"},array:{type:"array",error:"{p} must be an array with 1+ elements"}},this.knownParams={event_action:{beacon:"ea"},event_category:{beacon:"ec"},event_labe
Dec 14 18:07:01 kwikie steam.desktop[10308]: GameAction [AppID 39120, ActionID 4] : LaunchApp changed task to ProcessingInstallScript with ""
Dec 14 18:07:01 kwikie steam.desktop[10308]: esync: up and running.
Dec 14 18:07:06 kwikie steam.desktop[10308]: message repeated 2 times: [ esync: up and running.]
Dec 14 18:07:10 kwikie steam.desktop[10308]: GameAction [AppID 39120, ActionID 4] : LaunchApp changed task to SynchronizingControllerConfig with ""
Dec 14 18:07:10 kwikie steam.desktop[10308]: GameAction [AppID 39120, ActionID 4] : LaunchApp changed task to SiteLicenseSeatCheckout with ""
Dec 14 18:07:10 kwikie steam.desktop[10308]: GameAction [AppID 39120, ActionID 4] : LaunchApp changed task to CreatingProcess with ""
Dec 14 18:07:10 kwikie steam.desktop[10308]: GameAction [AppID 39120, ActionID 4] : LaunchApp waiting for user response to CreatingProcess ""
Dec 14 18:07:10 kwikie steam.desktop[10308]: GameAction [AppID 39120, ActionID 4] : LaunchApp continues with user response "CreatingProcess"
Dec 14 18:
# config/initializers/warning_duck_punch.rb
module Warning
def self.warn(warning)
filename = "warnings.txt"
File.open(filename, 'a') { |f|
f << "#{warning}"
f << "=======================================\n"
}
end
@dchapman1988
dchapman1988 / launch_options.txt
Created March 10, 2012 02:35
My Counter-Strike 1.6 User Configuration
These are the Launch options I use:
-heapsize 1048576 -freq 60 -full -w 640 -h 480 -32bpp -gl -dxlevel 90 -noaafonts -console -nocrashdialog +map_background none -nojoy
Here are the ones that are available:
+map_background none -novid
-noforcemaccel ; Use desktop mouse acceleration settings
-noforcemspd ; Use desktop mouse speed settings.
-noforcemparms ; Use desktop mouse buttons settings.
-noaafonts ; Disables Anti-Aliasing of Screen Fonts.
FW Macro, ekkehard's is behind it to use as nonphys for ranged rotation, glacial and icy behind FW in case you enter melee as you're attempting to use ekkehards.
#show Frozen Wrath
suppressmacrofailures
cast Frozen Wrath
cast Glacial strike
cast Icy blow
cast Ekkehard's grasp
Phys macro for pvp (swap in glacial shield instead of shield of oak for pve).
# This goes in your ~/.bashrc
if [ -f ~/.bash_files/prompts/elite ]; then
. ~/.bash_files/prompts/elite
elite
fi
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
h2 {
font-family: Lobster, Monospace;
}
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;