This file contains hidden or 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 PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>Test primacy</title> | |
<meta http-equiv="keywords" content=""> | |
<meta http-equiv="description" content=""> | |
<style type="text/css" media="screen"> | |
body { | |
padding: 20px; |
This file contains hidden or 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 | |
Class Page { | |
var $template; | |
var $partials; | |
# | |
# This faked data will be dynamically created (by searching through and parsing the /content folder) and stored within the Page class | |
# | |
var $data = array( |
This file contains hidden or 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 | |
Class Helpers { | |
static function sort_by_length($a,$b){ | |
if($a == $b) return 0; | |
return (strlen($a) > strlen($b) ? -1 : 1); | |
} | |
static function file_path_to_url($file_path) { |
This file contains hidden or 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
// | |
// Simple javascript truncate function | |
// | |
// Extend the string object to allow truncation | |
String.prototype.truncate = function(length) { | |
return this.length > length ? this.substring(0, length) + '…' : String(this); | |
} | |
// Usage |
This file contains hidden or 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
<script> | |
/* | |
Transform a standard js object into a callable function with all the same properties as the original object. | |
*/ | |
/* Variables */ | |
var o = { test: 'data1', test2: 'data2' } | |
var func_body = function() { alert('hi'); } | |
/* Construction */ |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'net/http' | |
def validate(url) | |
uri = URI.parse(url) | |
response = Net::HTTP.get_response(uri) | |
case response | |
when Net::HTTPSuccess | |
return uri |
This file contains hidden or 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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Cross-browser kerning-pairs & ligatures</title> | |
<style> | |
body { font-family: sans-serif; background: #f4f3f3; color: rgba(40, 30, 0, 1); width: 500px; margin: 80px auto; padding: 0px; } | |
a { color: rgba(15, 10, 0, 0.8); text-decoration: none; border-bottom: 1px solid; padding: 1px 1px 0px; -webkit-transition: background 1s ease; } | |
a:hover { background: rgba(0, 220, 220, 0.2); } | |
p, li { line-height: 1.5; padding: 0em 1em 0em 0em; margin: 0em 0em 0.5em; } |
This file contains hidden or 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
var balanced_parens = function(str) { | |
var stack = arguments[1] || []; | |
if (str.charAt(0) == '') { | |
return stack.length === 0; | |
} | |
else if (str.charAt(0) == '{') { | |
stack.push(str); | |
} |
This file contains hidden or 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
/* | |
Delay function call by a specified time | |
--------------------------------------------- | |
If the method is called again before the delay is up, reset the delay. | |
An optional id can be passed to prevent timeout collisions. | |
*/ | |
Function.prototype.sleep = function(ms, id) { |
This file contains hidden or 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
server.bind = "0.0.0.0" | |
server.port = 3000 | |
server.document-root = CWD | |
server.dir-listing = "enable" | |
accesslog.use-syslog = "disabled" | |
accesslog.filename = "/var/log/lighttpd/access.log" | |
index-file.names = ( "index.html" ) | |
mimetype.assign = ( | |
".css" => "text/css", |
OlderNewer