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
<div class="slider-viewport"><!-- works as a viewport for the 3D transitions --> | |
<div class="content-box"><!-- the 3D box --> | |
<figure><!-- slide --> | |
<img src="img/slide-1.png"> | |
<figcaption>This is slide one's description</figcaption> | |
</figure> | |
<figure><!-- slide --> | |
<img src="img/slide-2.png"> | |
<figcaption>This is slide two's description</figcaption> | |
</figure> |
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
{ | |
"item": [ | |
{"text": "Number one", "value": 23}, | |
[12,42,55,31,74] | |
] | |
} |
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 SystemUser | |
def initialize(first_name, last_name) | |
@credentials = { | |
:first_name => first_name, | |
:last_name => last_name | |
} | |
end | |
def method_missing(m, *args) |
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
File.open('demo.txt', 'a') do |f| | |
f.puts 'In and out, nice and clean' | |
end | |
# File is closed |
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 SystemUser | |
def initialize(first_name, last_name) | |
@credentials = { | |
:first_name => first_name, | |
:last_name => last_name | |
} | |
end | |
def set_credentials(creds) |
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 AccessGroup | |
attr_accessor :name | |
def initialize(name) | |
@name, @members = name, [] | |
end | |
# add the user to the group using the common shift operator | |
# used by collections |
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
<cfscript> | |
path = []; // cached path out to root node | |
ended = false; // ended = true once we reach the root | |
nodeID = 1; // leaf node db id --would have been passed in | |
level = 1; // levels up from leaf nodeID | |
// very simplified version of the code | |
while (!ended) { | |
parentDept = getParentDept(nodeID); | |
if (parentDept) { |
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
<cfscript> | |
// read in log file contents | |
accessLog = fileRead("/var/log/apache2/access.log"); | |
// set up our regular expression with groups | |
regex = 'GET\s([^\s]+)\sHTTP\/\d.\d"\s404\s[0-9]+\s"([^"]+)'; | |
// Using rematch we lose our groups | |
matches = REMatch(regex, accessLog); | |
writeDump(matches); |
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 | |
require 'api_cache/API_cache.php'; | |
$cache_file = 'twitter.json'; | |
$api_call = 'http://search.twitter.com/search.json?q=nodeJS&lang=en'; | |
$cache_for = 5; // cache results for five minutes | |
$api_cache = new API_cache ($api_call, $cache_for, $cache_file); | |
if (!$res = $api_cache->get_api_cache()) |
NewerOlder