# change mirror to ubuntu.osuosl.org first
sudo apt-get update
sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev
/** | |
* Generates JavaScript version of HTML templates for AngularJS as part of a Grunt build | |
* | |
* Allows for bundling into multiple collections, for applications that are distributed across more than one page. | |
* | |
* Usage (in grunt.initConfig): | |
* | |
* html2js: { | |
* firstTemplateCollection: { | |
* src: ['<%= src.first %>'], |
require 'function' | |
# A fibonacci function. | |
fib = Function.new | |
fib[0] = 0 | |
fib[1] = 1 | |
fib[Integer] = proc { |i| fib[i - 2] + fib[i - 1] } | |
p fib[0] # => 0 |
module Jekyll | |
class LessConverter < Converter | |
safe true | |
priority :high | |
def setup | |
return if @setup | |
require 'less' | |
@setup = true | |
rescue LoadError |
# generate using this gems : http://rubygems.org/gems/terminal-table | |
require "terminal-table" | |
title = "posts" | |
properties = ["id", "title", "author_name", "body"] | |
r = [] | |
r << [1, "I love dogs", "John", "woof"] | |
r << [2, "cars are great", "Sara", "I think they are"] |
## Week 3 Quiz | |
## 1) What does ERB stand for? | |
Embedded Ruby | |
## 2) What is the name of the place (library) where additional built in Ruby functions can be accessed? | |
STDlib |
# http://llvm.org/apt/ | |
sudo bash -c "cat >> /etc/apt/sources.list" << LLVMAPT | |
# LLVM | |
deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main | |
deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty main | |
# 3.5 | |
deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5 main | |
deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5 main | |
# 3.6 |
function validemail(str) | |
if str == nil then return nil end | |
if (type(str) ~= 'string') then | |
error("Expected string") | |
return nil | |
end | |
local lastAt = str:find("[^%@]+$") | |
local localPart = str:sub(1, (lastAt - 2)) -- Returns the substring before '@' symbol | |
local domainPart = str:sub(lastAt, #str) -- Returns the substring after '@' symbol | |
-- we werent able to split the email properly |
// 'spirals' by dave | |
int[][] result; | |
float t, c; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |