Skip to content

Instantly share code, notes, and snippets.

@greydnls
greydnls / gist:21a377daf4f8224e0dda
Created July 9, 2014 02:29
Rewriting some history.
git clone https://github.com/ProgrammingAreHard/ResourceBundle.git
git checkout -b "rewriteHistory"
git log --oneline --graph
git checkout ac97baa
git merge origin/master --squash
git commit
@greydnls
greydnls / 0_reuse_code.js
Created August 18, 2014 20:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Keybase proof

I hereby claim:

  • I am kayladnls on github.
  • I am kayladnls (https://keybase.io/kayladnls) on keybase.
  • I have a public key whose fingerprint is FF80 F5CF AE4E 35F9 5AF3 2585 844E 177D 1843 F73C

To claim this, I am signing this object:

Array
(
[query] => select *, sum((ifnull(`debit`,0) - ifnull(`credit`,0))) AS `amount`, `acct_journal_details`.*, `acct_journal`.`employee_id` from `acct_journal_details` inner join `acct_journal` on `acct_journal`.`acct_journal_id` = `acct_journal_details`.`acct_journal_id` where `is_per_diem` <> ? and `acct_journal`.`employee_id` in (?, ?, ?, ?) group by `acct_journal`.`employee_id`, `acct_journal_details`.`ref_date` having `amount` <> ?
[bindings] => Array
(
[0] => FirstWhere
[1] => Having
[2] => Relationship
[3] => Relationship
[4] => Relationship
@greydnls
greydnls / gradient_descent.php
Last active August 29, 2015 14:06
Gradient Descent
<?php
function computeErrorForLineGivenPoints($b, $m, array $points)
{
$total_error = 0;
foreach ($points as $point)
{
$total_error += pow(($point['y'] - ($m * $point['x'] + $b)), 2);
}
@greydnls
greydnls / sbpp_recipe.md
Last active July 21, 2018 12:50
Skillet Beef Pot Pie

Ingredients

  1. Beef stew meat (I actually used a pot roast that I cut into even sized pieces)
  2. ~6 Carrots
  3. ~3 small sweet potatoes (I used these because I had them to use. Regular potatoes would be fine)
  4. 1 medium onion
  5. 1 package sliced mushrooms
  6. Puff pastry
  7. Rosemary
  8. Flour
@greydnls
greydnls / rule30
Last active August 29, 2015 14:11
Rule 30
<?php
$lines = array();
$first_line = array_fill(0, 51, '*');
$first_line[24] = '/';
$lines[] = $first_line;
$rules = array(
'///'=> '*',
'//*' => '*',
@greydnls
greydnls / rule110
Created December 10, 2014 18:08
Rule 110
<?php
$lines = array();
$first_line = array_fill(0, 51, '*');
$first_line[24] = '/';
$lines[] = $first_line;
$rules = array(
'///'=> '*',
'//*' => '/',

B3(z) = Original notation
T(z) == name he's giving for function

T(z) = 1 + zT(z)3

What this says: Either Tree is empty (1) or Tree has one node (z) + 3 more ternary trees (T(z)) Because there are 3 of them, we cube (T(z))

@greydnls
greydnls / TofZ.php
Created December 14, 2014 00:59
TofZ
<?php
/**
* Created by PhpStorm.
* User: kayladnls
* Date: 12/13/14
* Time: 7:24 PM
*/
// Bt(z)^r == sigma(k) * (tk + r, k) * r / tk + r * z^k
// Problem: Compute the number of 4th order ternary trees;