This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dungeon < ActiveRecord::Base | |
has_many :wizards, through: :dungeon_wizard | |
has_many :dungeon_wizard | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d = Dungeon.create name: 'The Pit of Dispair' | |
w = Wizard.new name: 'Merlin' | |
w.dungeons << d | |
w.save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(0.1ms) begin transaction | |
SQL (0.6ms) INSERT INTO "wizards" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-04-14 22:18:36.904177"], ["name", "Merlin"], ["updated_at", "2014-04-14 22:18:36.904177"]] | |
SQL (0.2ms) INSERT INTO "dungeon_wizards" ("created_at", "dungeon_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-04-14 22:18:36.906145"], ["dungeon_id", 2], ["updated_at", "2014-04-14 22:18:36.906145"]] | |
SQL (0.2ms) UPDATE "dungeon_wizards" SET "updated_at" = ?, "wizard_id" = ? WHERE "dungeon_wizards"."id" = 1 [["updated_at", "2014-04-14 22:18:36.907402"], ["wizard_id", 1]] | |
(1.3ms) commit transaction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pry' | |
# A linear algebra matrix row. | |
class Row | |
def initialize(arr) | |
@arr = arr.map(&:to_r) | |
end | |
def map_with_index | |
arr = @arr.map.with_index do |val, i| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$starting_links = array('http://a5.mzstatic.com/us/r1000/107/Music/v4/3a/1c/4b/3a1c4bff-7b99-2162-3036-54157c6924e6/0818610010094_1200x1200_300dpi.100x100-75.jpg',); | |
$timeout = 1; // In seconds | |
foreach ($starting_links as $link) { | |
$curr_size = 25; | |
while ($curr_size < 2000) { | |
$result = get_headers(str_replace('100x100', $curr_size . 'x' . $curr_size, $link)); | |
if ($result[0] === 'HTTP/1.0 404 Not Found') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC libavdevice/alldevices.o | |
CC libavdevice/avdevice.o | |
CC libavdevice/lavfi.o | |
CC libavfilter/af_aconvert.o | |
CC libavfilter/af_aformat.o | |
CC libavfilter/af_amerge.o | |
CC libavfilter/af_amix.o | |
CC libavfilter/af_anull.o | |
brew: superenv removed: -I./ -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O3 | |
brew: superenv removed: -I./ -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Audio Streaming test</title> | |
</head> | |
<body> | |
<div> | |
<p> | |
Test page for Kindle Fire Audio Streaming. Using 89.3 The Current as an example. | |
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>This is an audio tag test.</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> | |
<style> | |
.button { | |
display: block; | |
padding: 10px; | |
border: 1px solid gray; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table> | |
<tr> | |
<td> </td> | |
<td> Pure JS - Different vars </td> | |
<td> Pure JS - Same var </td> | |
<td> SM2 - Same var </td> | |
<td> SM2 - Different vars </td> | |
<td> SM2 - Same ID </td> | |
</tr> | |
<tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>This is an audio tag test.</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script src="soundmanager/script/soundmanager2.js"></script> | |
<script> | |
$(function(){ | |
soundManager.setup({ |
OlderNewer