Skip to content

Instantly share code, notes, and snippets.

View m6tt's full-sized avatar

Matt Woodfield m6tt

View GitHub Profile
@m6tt
m6tt / ConnHelper.java
Created November 13, 2011 17:52
Android Connectivity helper
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
public class ConnHelper {
public static NetworkInfo getConnectivityStatus(Context context) {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
return cm.getActiveNetworkInfo();
}
@m6tt
m6tt / jquery-doc-ready
Created September 19, 2011 14:45
Jquery document ready, can never remember this
jQuery(function() {
$(document).ready(function() {
});
});
@m6tt
m6tt / less-mixin-transtition
Created September 4, 2011 22:37
Less Mixin - Transition
.transition (@property: all, @duration: 0.5s, @ease: linear, @delay: 0.0s) {
-webkit-transition: @arguments;
-moz-transition: @arguments;
-o-transition: @arguments;
transition: @arguments;
}
@m6tt
m6tt / less-mixin-rounded-corners
Created September 4, 2011 22:34
Less Mixin - Rounded Corners
.rounded-corners (@radius: 5px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
@m6tt
m6tt / less-mixin-box-shadow
Created September 4, 2011 22:30
Less Mixin - Box shadow
.box-shadow (@x: 0px, @y: 0px, @blur: 1px, @colour: rgba(0, 0, 0, 0.2)) {
-webkit-box-shadow: @arguments;
-moz-box-shadow: @arguments;
box-shadow: @arguments;
}