Skip to content

Instantly share code, notes, and snippets.

View ryankinal's full-sized avatar

Ryan Kinal ryankinal

View GitHub Profile
@ryankinal
ryankinal / README.md
Created December 1, 2017 16:39
Copies course listings code to a pantheon environment.

This script should be downloaded and customized to your local environment. The script copies code from the course listings plugin (as defined on line 16) to a temp directory, does some cleanup, and then copies it to a default site (line 3) or to the specified site (with the -s option).

Usage

cltowp [-s [site]] [-n]

Options

  • -s - Copies the course listings code to the provided site
  • -n - Copies vendor and node_modules directories in addition to source code
@ryankinal
ryankinal / curriculum.md
Last active October 27, 2016 16:40
JS Curriculum

JS Curriculum

Goals:

  • Know the language.
  • HTTP requests/responses
  • Be able to create client-side and server-side code effectively, with a focus toward the toolsets being used for McKissock S1.
  • A probject of some hopefully useful sort

Sections

var base = {
getType: function() {
return 'badass';
}
};
var user = Object.create(base);
user.setName = function(name) {
this.name = name;
};
@ryankinal
ryankinal / gulpfile.js
Created July 5, 2016 19:37
Synchronous vs. Asynchronous tasks
/*
There are three main tasks I want to run one after the other (synchronously).
Some of these tasks are divided into smaller tasks which can be run concurrently.
Based on the output of gulp, it seems that this isn't quite happening,
though I may be misreading it.
Output:
[15:14:07] Using gulpfile ~\projects\colibri\common-client\gulpfile.js
[15:14:07] Starting 'lint'...
[15:14:07] Finished 'lint' after 18 ms
@ryankinal
ryankinal / link.txt
Created October 1, 2013 14:01
JavaScript is Jarig
@ryankinal
ryankinal / button.html
Created June 7, 2013 13:54
Ah, building buttons with tables
<table id='tbl_custpage_filter' cellpadding='0' cellspacing='0' border='0' style='margin-right:6px;cursor:hand;'>
<tr id='tr_custpage_filter' class='pgBntG'>
<td id='tdleftcap_custpage_filter'>
<img src='/images/nav/ns_x.gif' class='bntLT' border='0' height='50%' width='3' />
<img src='/images/nav/ns_x.gif' class='bntLB' border='0' height='50%' width='3' />
</td>
<td id='tdbody_custpage_filter' height='20' valign='top' nowrap class='bntBgB'>
<input type='button' style='' class='rndbuttoninpt bntBgT' value='Apply Filter' id='custpage_filter' name='custpage_filter' onmousedown="this.setAttribute('_mousedown','T'); setButtonDown(true, false, this);" onmouseup="this.setAttribute('_mousedown','F'); setButtonDown(false, false, this);" onmouseout="if(this.getAttribute('_mousedown')=='T') setButtonDown(false, false, this);" onmouseover="if(this.getAttribute('_mousedown')=='T') setButtonDown(true, false, this);" >
</td>
<td id='tdrightcap_
@ryankinal
ryankinal / index.html
Created June 4, 2013 20:38
jQuery breaking
<html>
<head>
<title>jQuery can break too</title>
<script>
$('#myDiv').size(); // 0
</script>
</head>
<body>
<div id="myDiv"></div>
<script>
@ryankinal
ryankinal / index.html
Created June 4, 2013 20:34
Fucking solution, motherfucker.
<html>
<head>
<title>DOING SMART STUFF</title>
<script src="library.js"></script>
</head>
<body>
<h1>OMG some DOM</h1>
<div>Some more elements</div>
<script>
myLib.start();
him:
I just rick rolled javascript
it took me about 3 days
but victory is mine!
I thought you might appreciate that type of statement
me:
Er... what?
him:
@ryankinal
ryankinal / its-magic.md
Last active December 15, 2015 17:20
Magic is great. Except for when it doesn't work.

It's almost a comedy trope.

The amateur magician attempts an illusion in front of a large crowd, puts on a good show, and then fails miserably. He's boo'd off the stage, shamed and cowering from the cartoon-like rotten fruit and harsh words of his disappointed and angry audience. When magic doesn't work, it's a sad, frustrating, and disillusioning experience. Any suspension of disbelief disappears, as perhaps the original trick had intended something else to vanish.

And the same goes for "black box" solutions in development. They're fine until they don't work, at which point you have to dig into the abstraction to figure out why, and all the voluntary ignorance disappears. You suddenly find out what's inside the box, and it's nothing special.

It's not magic.

Depending on your abstraction, it might not even be good code.