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
// By David Pedersen (@davidpdrsn) | |
// https://gist.github.com/davidpdrsn/3101105 | |
// Version 0.2 | |
////////////////////////////////////// | |
/// Media queries //////////////////// | |
////////////////////////////////////// | |
// Foundation 3 | |
@mixin small { |
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
/* | |
* By David Pedersen (@davidpdrsn) | |
* https://gist.github.com/davidpdrsn/4434085 | |
* Version 0.1 | |
*/ | |
jQuery.fn.isInView = function(){ | |
// setup different vars for easier access to these values | |
var middle = Math.round(this.height() / 2), | |
winHeight = $(window).height(), |
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
Testing http://3f.dk | |
At Wed Jul 10 14:23:53 2013 | |
10 loops | |
Fastest Median Slowest Std Dev | |
--------------------------------------------------------------------------- | |
Server performance: | |
Total application time Unable to be recorded |
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 'fileutils' | |
files = Dir.glob("**/*").select do |file| | |
file if file.match /\.(ttf|otf)$/i | |
end | |
files.each do |file| | |
FileUtils.cp_r file, "/Users/#{`whoami`.chomp}/Library/Fonts", :verbose => true | |
FileUtils.rm_r file, :verbose => true | |
puts "" |
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
local | |
(* sum of a list of ints | |
sum : int list -> int *) | |
fun sum l = foldl op+ 0 l | |
(* avarage of a list of ints | |
avg : int list -> real *) | |
fun avg l = real(sum(l)) / real(length(l)) | |
in | |
(* calculate the amount of time it takes to run a function once |
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
(* sorted : int list -> bool | |
* check if a list of ints is sorted *) | |
fun sorted [] = true | |
| sorted [x] = true | |
| sorted (x::y::xs) = x < y andalso sorted (y::xs) | |
val sorted_test1 = sorted [1,2,3] | |
val sorted_test2 = not (sorted [2,1,3]) | |
val sorted_test3 = not (sorted [2,3,1]) | |
val sorted_test4 = sorted [] |
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
describe('lastViewedPages', function() { | |
var pages = null; | |
beforeEach(function() { | |
localStorage.clear(); | |
pages = new LastViewedPages(); | |
}); | |
it("doesn't come with pages already saved", 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
Dir.glob("*.java").each do |f| | |
contents = File.read f | |
folder = contents. | |
split("\n"). | |
first. | |
delete("/"). | |
delete(" "). | |
delete(",test"). | |
delete(",implementation"). |
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
import java.util.*; | |
import static org.junit.Assert.*; | |
import static org.hamcrest.CoreMatchers.*; | |
import org.junit.Test; // for @Test | |
import org.junit.Before; // for @Before | |
import org.junit.Ignore; // for @Ignore | |
import org.junit.runner.RunWith; | |
import org.junit.runners.JUnit4; |
OlderNewer