Skip to content

Instantly share code, notes, and snippets.

View Yardboy's full-sized avatar

Cayce Balara Yardboy

View GitHub Profile
@Yardboy
Yardboy / gist:05bb7f5044d7db2bbf5a
Created August 27, 2014 18:51
Ruby any? and all? with an empty array as receiver.
2.0.0-p451 :001 > [].any? { |wtf| wtf.locked? }
=> false
2.0.0-p451 :002 > [].all? { |wtf| wtf.locked? }
=> true

Keybase proof

I hereby claim:

  • I am yardboy on github.
  • I am yardboy (https://keybase.io/yardboy) on keybase.
  • I have a public key whose fingerprint is D4DD 53FA 06C1 00F8 6C05 99C6 5E23 3796 3F29 EED8

To claim this, I am signing this object:

var DNA = function(sequence) {
var count, checkMarker;
var nucleotideCounts = {};
var displayedMarkers = ['A', 'T', 'C', 'G'];
var acceptedMarkers = displayedMarkers + ['U'];
count = function(marker){
checkMarker(marker);
return sequence.split(marker).length - 1;
}
@Yardboy
Yardboy / CTF 2014 Level 0
Created January 22, 2014 22:48
CTF 2014 Level 0
#!/usr/bin/env ruby
# Our test cases will always use the same dictionary file (with SHA1
# 6b898d7c48630be05b72b3ae07c5be6617f90d8e). Running `test/harness`
# will automatically download this dictionary for you if you don't
# have it already.
path = ARGV.length > 0 ? ARGV[0] : '/usr/share/dict/words'
entries = File.read(path).split("\n")
@Yardboy
Yardboy / gist:8293540
Last active January 2, 2016 10:59
Capitalization or Expensing of Software Development Costs
C:
---
To my knowkedge, the capitalization or expensing of costs related to software development depend on the
type of activity, not how the project might have been planned. For instance, planning and feasibility
research type costs are to be expensed when incurred, while application development costs are
capitalized. In the case of software to be sold, there is also a determination of feasbility point to
be considered when drawing the line between expense as incurred and capitalize. I believe the guiding
standards come from FASB 86 and AICPA SOP 98-1.
R's question seemed to imply that this was a "univeral rule", so I would be interested to hear what
district_rankings_options[0] = {
chart: {
renderTo: 'district_rankings_chart',
type: 'column',
height: 400,
shadow: false
},
legend: false,
plotOptions: {
series: {
@Yardboy
Yardboy / gist:4278677
Created December 13, 2012 18:53
Splitting into three, splitting into four.
# Let's say you have a collection of seven items:
['a', 'b', 'c', 'd', 'e', 'f', 'g']
# and you want to split it into three groups. What should the result be?
A.
[
['a', 'b', 'c'],
['d', 'e'],
@Yardboy
Yardboy / rumblestackscripterrors
Created October 13, 2012 00:14
Rumble stack script stalled, errors
Setting up libtinfo-dev (5.9-4) ...
Setting up libreadline6-dev (6.2-8) ...
Setting up libreadline-dev (6.2-8) ...
Installing: Ruby
--2012-10-13 00:07:21-- ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
=> `ruby-1.9.3-p194.tar.gz'
Resolving ftp.ruby-lang.org (ftp.ruby-lang.org)... 221.186.184.68
Connecting to ftp.ruby-lang.org (ftp.ruby-lang.org)|221.186.184.68|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
@Yardboy
Yardboy / Fish Applet Object Code
Created September 3, 2012 22:51
Fish Applet Object Code
<object type="application/x-shockwave-flash" style="outline:none;" data="http://hosting.gmodules.com/ig/gadgets/file/112581010116074801021/fish.swf?up_fishName=GroovyFish&amp;up_fishColor10=66420C&amp;up_fishColor3=4340F4&amp;up_fishColor8=FA0047&amp;up_fishColor9=6A8038&amp;up_fishColor7=40C7F4&amp;up_numFish=10&amp;up_backgroundImage=http://&amp;up_fishColor4=F4E540&amp;up_foodColor=66420C&amp;up_fishColor2=DC40F4&amp;up_fishColor1=F45540&amp;up_fishColor6=F48540&amp;up_fishColor5=40F45E&amp;up_backgroundColor=C5DDFA&amp;" width="500" height="333"><param name="movie" value="http://hosting.gmodules.com/ig/gadgets/file/112581010116074801021/fish.swf?up_fishName=GroovyFish&amp;up_fishColor10=66420C&amp;up_fishColor3=4340F4&amp;up_fishColor8=FA0047&amp;up_fishColor9=6A8038&amp;up_fishColor7=40C7F4&amp;up_numFish=10&amp;up_backgroundImage=http://&amp;up_fishColor4=F4E540&amp;up_foodColor=66420C&amp;up_fishColor2=DC40F4&amp;up_fishColor1=F45540&amp;up_fishColor6=F48540&amp;up_fishColor5=40F45E&amp;up_backgroundCo
@Yardboy
Yardboy / javascript.js
Created February 7, 2011 03:21
site hover function review
// the function gets called inline via the onmouseover and onmouseout events like this
P7_MultiClass2('L3','show','nav_03','active_03')"
// essentially, the function is using the calling parameters to set set the classname for another item on the page
// since the classname they're adding is the "active_03", "active_04", etc., this is triggering the display of
// the submenu when you hover the nav item.
function P7_MultiClass2() {
var args=P7_MultiClass2.arguments;
// so, args = ['L3','show','nav_03','active_03']
if(document.getElementById) {