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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace RLUtils | |
| { | |
| /// <summary> | |
| /// Creates an Comparer for a type | |
| /// </summary> |
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
| public static class EnumerableExtensions | |
| { | |
| public static IEnumerable<TSource> Distinct<TSource>(this IEnumerable<TSource> enumerable, Func<TSource, TSource, bool> comparer) | |
| { | |
| return enumerable.Distinct(new LambdaComparer<TSource>(comparer)); | |
| } | |
| public static IEnumerable<TSource> Except<TSource>(this IEnumerable<TSource> first, IEnumerable<TSource> second, Func<TSource, TSource, bool> comparer) | |
| { | |
| return first.Except(second, new LambdaComparer<TSource>(comparer)); |
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 'json' | |
| require 'fileutils' | |
| include FileUtils | |
| # Parses the argument array _args_, according to the pattern _s_, to | |
| # retrieve the single character command line options from it. If _s_ is | |
| # 'xy:' an option '-x' without an option argument is searched, and an | |
| # option '-y foo' with an option argument ('foo'). |
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> | |
| <head> | |
| <meta name='viewport' content='width=device-width, initial-scale=1,maximum-scale=1,user-scalable=0' /> | |
| <title>My Fluid Pages</title> | |
| <link rel='stylesheet' href='styles.css' /> | |
| </head> | |
| <body> | |
| <div id='logo'> | |
| <div>Fluidity</div> |
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 'base64' | |
| require 'open-uri' | |
| # file or url | |
| def get_css(src) | |
| if src.start_with? 'http' | |
| src = src.gsub('|', '%7C') | |
| STDERR.puts "# GET #{src}" | |
| # simulate modern browser to get woff |
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
| package main | |
| import ( | |
| "bytes" | |
| "encoding/hex" | |
| "flag" | |
| "fmt" | |
| "io" | |
| "log" | |
| "net" |
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
| /** | |
| * Dead Center an element with display: inline-block | |
| */ | |
| html, | |
| body { margin: 0; height: 100%; } | |
| .container { | |
| letter-spacing: -0.31em; | |
| text-rendering: optimizespeed; |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| {-# LANGUAGE EmptyDataDecls #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE QuasiQuotes #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE TypeSynonymInstances #-} | |
| {-# OPTIONS_GHC -fno-warn-orphans #-} |
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 python | |
| # based on cb-exit used in CrunchBang Linux <http://crunchbanglinux.org/> | |
| import pygtk | |
| pygtk.require('2.0') | |
| import gtk | |
| import os | |
| import getpass |