Skip to content

Instantly share code, notes, and snippets.

View livando's full-sized avatar

Don Livanec livando

View GitHub Profile
@livando
livando / remote_branch.sh
Created September 28, 2016 13:50
git checkout and track remote branch
git fetch
git checkout <branch>
@livando
livando / weights.cpp
Created August 23, 2016 15:19
weights.cpp
//Manning, Joshua
//CSE 100
//[email protected]
//HW1_Weights
#include <iostream>
using namespace std;
int main()
{
$ irb -ryaml
>> YAML.load_file 'x.yml'
@livando
livando / designer.html
Last active August 29, 2015 14:11
designer
<link rel="import" href="../code-mirror/code-mirror.html">
<link rel="import" href="../topeka-elements/avatars.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<link rel="import" href="../speech-mic/speech-mic.html">
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
#!/bin/bash
###
#
# Ubuntu 12.04 based web server installation script
# Run this by executing the following from a fresh install of Ubuntu 12.04 server:
#
# bash -c "$(curl -fsSL https://raw.github.com/gist/4372049)" <mysqlPassword>
#
# Be sure to replace <mysqlPassword> with your intended MySQL Password.
@livando
livando / myslnotes
Created January 9, 2013 15:17
MySQL notes
to change root user password
mysql -u root -h localhost -p
root
mysql> use mysql;
mysql> update user set password=PASSWORD("") where User='root';
mysql> flush privileges;
mysql> quit
update user set password=PASSWORD("foobar") where User='root';
@livando
livando / scoping_capybara.rb
Created December 7, 2012 15:03
scoping capybara
#scoping capybara
within(".comment") do
click_on("View")
end
@livando
livando / goog_finance.rb
Created November 30, 2012 14:14
Pulling stock dividend from google finance
require 'json'
require 'open-uri'
url = "http://www.google.com/finance/info?infotype=infoquoteall&q=goog"
json = open(url).read[3..-1]
result = JSON.parse json
result.first["yld"]
@livando
livando / devise_msgs.rb
Created November 16, 2012 14:40
Pull Devise messages from YAML
msgs = YAML::load(File.open("#{::Rails.root.to_s}/config/locales/devise.en.yml"))
 
msgs['en']['devise']['failure']['unauthenticated']
@livando
livando / pjax
Created September 2, 2012 17:40
Pjax implementation in Rails
1) add gem
2) create vendor directory, and download script
3) configure application.rb
4) write js that points the trigger to the displayer
5) ensure the trigger has the correct jquery selector
6) ensure the displayer has the correct jquery selector
1) add gem
gem 'rack-pjax'