Skip to content

Instantly share code, notes, and snippets.

View caleywoods's full-sized avatar

Caley Woods caleywoods

View GitHub Profile
bind "INS" "demo_togglepause" // Pause demo
bind "DEL" "demoui"
bind "HOME" "demo_timescale" // Full Speed
bind "END" "demo_timescale .4" // 50% Speed
// DATE 2/16/2013
alias "m4a1/ak47" "buy m4a1;buy ak47"
bind "MOUSE5" "m4a1/ak47"
// removes the shifting of the arm when crouching down.
cl_viewmodel_shift_left_amt "0"
cl_viewmodel_shift_right_amt "0"
@caleywoods
caleywoods / teams.md
Last active January 2, 2016 14:39
CS Team History

CS Teams

####StugotZ CALo Season 8

Ravi, Whack, Fo, Monstro, dfnkt, fish, hydro (6-2, 1-1)

####UNR CALim Season 9

teh`ror, james, abox, dfnkt, tunafish (11-5, 0-1)

####UNR CALim season 10

@caleywoods
caleywoods / botdm.cfg
Created October 22, 2013 22:04
Bot DM config for CS:Global Offensive
// Bot DM script
sv_cheats 1
// Remove, set 0 or put in // if you don't want replenished ammo or set 2 if you'd rather reload your weapon
//sv_infinite_ammo 0
mp_round_restart_delay 0
mp_freezetime 0
mp_spawnprotectiontime 0

CSV Factory

This class implements the singleton pattern to create a class that accepts input (usually an array, from a database query) and attempts to turn it into a CSV file so that a download can be presented to a user. This is currently being used in a Zend application but should be applicable to most environments.

Example Usage

note: I have a DataController that extends from a custom Zend controller I wrote that disables template and layout rendering so I don't have to do it for every action. This may not be applicable to you. The important bit is that I'm preventing a layout or view from being rendered in Zend Framework (we're typically returning JSON from these controllers).

  • Place CSVFactory.php in your models folder
  • Create an action in the controller that can be called. I've named mine CSVAction().
  • My CSVAction() looks like this:
http://media.mtvnservices.com/embed/mgid:uma:videolist:mtv.com:1697171/cp~instance%3Dfullepisode%26autoPlay%3Dfalse%26id%3D1697171%26uri%3Dmgid%3Auma%3Avideolist%3Amtv.com%3A1697171&#34
@caleywoods
caleywoods / 00_README.md
Created October 3, 2012 00:17
Get all notes in a presentation.

#PPT Notes Extractor# This VBS will prompt for a path to a PPT file and attempt to take all the slide notes and place them in a notepad plaintext file in the following format:

Slide: 1

These are slide notes! There are a lot of notes here.

Slide: 2

Here are slide 2's notes.

var grid = Ext.ComponentQuery.query('myGridPanel').getSelectionModel(),
jsonArray = [];
// getSelection() returns an Array you can iterate over
Ext.Array.each( grid.getSelection(), function( record ){
jsonArray.push( record.data );
});
Ext.Ajax.request({
autoAbort : false,
// Take all of our Ext.data.Model selections from a grid and put them into an array
array = Ext.ComponentQuery.query('myGridPanel').getSelectionModel().getSelection();
// Make an AJAX request and send our JSON serialized array of models
// Since we specified a params config the method is POST
Ext.Ajax.request({
url : '/users',
params : {
data : Ext.encode( array )
},