Skip to content

Instantly share code, notes, and snippets.

View techniq's full-sized avatar

Sean Lynch techniq

View GitHub Profile
@techniq
techniq / readme.md
Created December 2, 2013 03:26
Chrome Android force desktop version
adb shell 'echo \"chrome --user-agent="[Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.23 Safari/537.36]"\" > /data/local/chrome-command-line'
@techniq
techniq / Docker.md
Last active December 29, 2015 00:19
Docker links
@techniq
techniq / background-color-rgba-mixin.scss
Created October 18, 2013 19:31
SCSS / Modernizer RGBA background-color mixin
@mixin background-color-rgba($red, $green, $blue, $alpha) {
$rgba: rgba($red, $green, $blue, $alpha);
background-color: transparent;
background-color: rgba($red, $green, $blue, $alpha);
.lt-ie9 & {
$ie-hex-color: ie-hex-str($rgba);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{ie-hex-color}, endColorstr=#{ie-hex-color}); /* IE */
zoom: 1;
}
@techniq
techniq / general.md
Created October 17, 2013 14:15
Linux info

Find out what shell you are currently running

echo $0

Pass output of command to another as argument

using backtick (`)

somecommand `anothercommand`
@techniq
techniq / clearfix_legacy.scss
Created October 11, 2013 01:25
Clearfix mixin clearfix_legacy.scss supports IE6+ clearfix_modern.scss is simplier and supports IE8+
// http://nicolasgallagher.com/micro-clearfix-hack/
// http://css-tricks.com/snippets/css/clear-fix/
@mixin clearfix {
// For modern browsers
&:before, &:after {
content: "";
display: table;
}
&:after {
clear: both;
using System;
using System.Collections.Generic;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
[XmlRoot("dictionary")]
public class XmlSerializableDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IXmlSerializable
{
public XmlSchema GetSchema()
public class MvcApplication : HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterRoutes(RouteTable.Routes);
SetupIoc();
}
@techniq
techniq / bootstrap-validation.js
Created June 11, 2013 14:46
jQuery Validation with Twitter Bootstrap
$("#someForm").validate({
errorClass:'error',
validClass:'success',
errorElement:'div',
highlight: function (element, errorClass, validClass) {
$(element).parents("div[class='control-group']")
.addClass(errorClass)
.removeClass(validClass);
},
unhighlight: function (element, errorClass, validClass) {
@techniq
techniq / smtp_debug.sh
Created May 6, 2013 14:01
Create an SMTP server which prints mail to stdout
python -m smtpd -n -c DebuggingServer localhost:1025
@techniq
techniq / anonymous_object_options.cs
Created March 20, 2013 18:48
Example using an anonymous object to pass in key/value options
public string Foo(object overrides = null)
{
if (overrides != null)
{
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(overrides))
{
var name = property.Name;
var value = property.GetValue(overrides);
...
}