Skip to content

Instantly share code, notes, and snippets.

View CodeKiwi's full-sized avatar

Josh Bondy CodeKiwi

View GitHub Profile

Keybase proof

I hereby claim:

  • I am codekiwi on github.
  • I am b83221e35367d277 (https://keybase.io/b83221e35367d277) on keybase.
  • I have a public key whose fingerprint is 2FAF CC77 6AFC CA79 B30E EC87 6292 B44C AD87 4570

To claim this, I am signing this object:

@CodeKiwi
CodeKiwi / gradientdescentforlinearregression
Created June 24, 2014 04:37
Gradient descent for linear regression.
class LinearRegression < Object::Base
def initialize(options)
@training_set = options['training_set']
@theta0 = options['theta0start']
@theta1 = options['theta1start']
@alpha = options['alpha']
end
def minimize_theta
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
#System information
glances
#Display disk usage
df
#Flush DNS cache
dscacheutil -flushcache;sudo killall -HUP mDNSResponder
#Display size of folder items
#Logs into MySQL with root account and asks password
mysql -u root -p
#Show the items for the selected type
show databases|tables|columns in <table>
#Show count of articles older than 30 days
SELECT COUNT(*) FROM articles WHERE date < DATE_SUB(NOW(), INTERVAL 30 DAY);
#Delete articles older than 30 days
@CodeKiwi
CodeKiwi / blockly.xml
Last active August 18, 2021 22:17
Testing Marlowe
When
[Case
(Deposit
(Role "Alice")
(Role "Alice")
(Token "" "")
(Constant 10)
)
(When
[Case