Skip to content

Instantly share code, notes, and snippets.

@trey
trey / rwd.css
Created January 26, 2012 20:14
Bootstrap's RWD breakpoints
/* http://twitter.github.com/bootstrap/scaffolding.html#responsive */
/* Landscape phones and down */
@media (max-width: 480px) { ... }
/* Landscape phone to portrait tablet */
@media (max-width: 768px) { ... }
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 940px) { ... }
@jameswyse
jameswyse / bootstrap-grid.css
Created March 3, 2012 15:10 — forked from abitgone/bootstrap-grid.css
Grid Overlay for Twitter Bootstrap
/*
* Grid Overlay for Twitter Bootstrap
* Assumes a 1.692em baseline grid (22px/13px)
*/
@media (min-width: 1200px) {
body {
background: -webkit-linear-gradient(
90deg,
rgba(0,0,0,0.05),
rgba(0,0,0,0.05) 4.545%,
@pgaertig
pgaertig / transpose_table.js
Created April 13, 2012 13:48
Transpose HTML table using jQuery
$(function() {
var t = $('#thetable tbody').eq(0);
var r = t.find('tr');
var cols= r.length;
var rows= r.eq(0).find('td').length;
var cell, next, tem, i = 0;
var tb= $('<tbody></tbody>');
while(i<rows){
cell= 0;
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@dlew
dlew / themes-debug.xml
Last active March 1, 2024 15:46
With the new theming in AppCompat, a lot of assets are tinted automatically for you via theme attributes. That has often led me to wonder "where the hell did this color come from?" You can replace your normal theme with this debug theme to help figure out the source of that color.
<!-- You can change the parent around to whatever you normally use -->
<style name="DebugColors" parent="Theme.AppCompat">
<!-- System colors -->
<item name="android:windowBackground">@color/__debugWindowBackground</item>
<item name="android:colorPressedHighlight">#FF4400</item>
<item name="android:colorLongPressedHighlight">#FF0044</item>
<item name="android:colorFocusedHighlight">#44FF00</item>
<item name="android:colorActivatedHighlight">#00FF44</item>
@YARG
YARG / gist:2b9a50abc9c3524d40fc
Last active January 15, 2020 14:15
C#/Xamarin Android - Converts a UTC DateTime to the device local Time Zone as System.DateTime. Also includes functions to convert Android native date times to System.DateTime and back again.
/// <summary>
/// Converts a UTC datestamp to the local timezone
/// </summary>
/// <returns>The UTC to local time zone.</returns>
/// <param name="dateTimeUtc">Date time UTC.</param>
public DateTime ConvertUTCToLocalTimeZone(DateTime dateTimeUtc) {
// get the UTC/GMT Time Zone
Java.Util.TimeZone utcGmtTimeZone = Java.Util.TimeZone.GetTimeZone ("UTC");
@yrom
yrom / SpacesItemDecoration.java
Last active September 2, 2018 16:57
SpacesItemDecoration for RecyclerView.
import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
public class SpacesItemDecoration extends RecyclerView.ItemDecoration {
private int space;
private int spanCount;
private int lastItemInFirstLane = -1;
public SpacesItemDecoration(int space) {
@sachintha81
sachintha81 / WPFMessengerClass.cs
Created January 13, 2017 21:23
Messenger Class for the WPF + MVVM Pattern
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MVVMMessenger
{
public class Messenger
@hesoyamcode
hesoyamcode / gist:d8df3e8761b68a1f25559f59934c03d5
Last active October 10, 2018 18:37
Error:java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands Ubuntu 64
Set Env variabel (type in your terminal) or set it on .bashrc or .bash_profile
===============================================================================
export ANDROID_HOME=/home/fuadaip/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
intall if not installed
===============================================================================
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1