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
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feeds/rss"> | |
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | |
<meta name="generator" content="CMS name"> | |
<!-- Open graph meta --> | |
<meta property="og:type" content="website"> | |
<meta property="og:site_name" content="Website title"> |
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> | |
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Breakpoint detection test</title> | |
<style type="text/css" media="screen"> | |
@media screen and (min-width: 320px) { | |
#page:after { | |
content: 'smallest'; /* represent the current width-bracket */ |
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
# The following will allow you to use URLs such as the following: | |
# | |
# example.com/anything | |
# example.com/anything/ | |
# | |
# Which will actually serve files such as the following: | |
# | |
# example.com/anything.html | |
# example.com/anything.php | |
# |
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
// http://davidwalsh.name/function-debounce | |
// Returns a function, that, as long as it continues to be invoked, will not | |
// be triggered. The function will be called after it stops being called for | |
// N milliseconds. If `immediate` is passed, trigger the function on the | |
// leading edge, instead of the trailing. | |
function debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { |
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
#!/usr/bin/env node | |
var fs = require('fs'); | |
var exec = require('child_process').exec; | |
/* | |
* lesswatch usage: | |
* | |
* `lesswatch` to watch the current directory |
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 | |
# Implements a recursive null object pattern. | |
# | |
# Implemented as a trait so any object can make it's properties use | |
# the null pattern without resorting to inheritance. | |
# | |
# The goal is so you can pull data off a partially populated object | |
# without excessive existance checks. | |
trait NullPattern { |
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
// hey, everybody! it's a tiny Web server! | |
// instead of a bunch of foo = reqire("foo") | |
// list our required modules and loop through | |
var r = [ "fs", "http", "mime", "path", "url" ]; | |
for (var i = 0; i < r.length; i++) { | |
global[r[i]] = require(r[i]); | |
} | |
// some constants |
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
%% Read image and convert to grayscale | |
img = imread('pic.jpg'); | |
img = rgb2gray(img); | |
%% Define grayscale representations of 0-255 | |
chars = fliplr([' ', '.', ',', ':', '-', '=', '+', '*', '#', '%', '@']); | |
step = 256 / 11; | |
%% Cut image so its size is 8*w times 13*h | |
imgSize = size(img); |
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
let re; | |
//this looks for the string between the slashes. it'll match hello but not HeLlo. | |
re = /hello/; | |
//the lower case i means be case insensitive. this will match HellO. | |
re = /hello/i; | |
// explaination for common search characters |
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
function has3d(){ | |
if (!window.getComputedStyle) { | |
return false; | |
} | |
var el = document.createElement('p'), | |
has3d, | |
transforms = { | |
'webkitTransform':'-webkit-transform', | |
'OTransform':'-o-transform', |
OlderNewer