Skip to content

Instantly share code, notes, and snippets.

View dezinezync's full-sized avatar
🏠
Working from home

Nikhil Nigade dezinezync

🏠
Working from home
View GitHub Profile
//LESS.JS MIXINS
.border-radius(@radius) {
border-radius: @radius;
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
-o-border-radius: @radius;
}
.box-shadow(@shadow) {
box-shadow: @shadow;
@dezinezync
dezinezync / app.js
Created July 31, 2012 11:41
Tweetie like TiUITableView cells
var data = [];
var t1;
var win = Ti.UI.createWindow({
width: Ti.UI.FILL,
height: Ti.UI.FILL,
backgroundColor: '#ffffff'
});
var tableView = Ti.UI.createTableView({
@dezinezync
dezinezync / test1.js
Created August 11, 2012 19:23 — forked from pec1985/test1.js
Optimizing Appcelerator's Titanium
/**
* Test #1
* Adding 10,000 Ti.UI.TableViewRows to a Ti.UI.TableView
* The rows have the Ti.UI.iPhone.TableViewCellSelectionStyle.BLUE constant in them
*
* Total time in my Mac: 1228ms
*/
var win = Ti.UI.createWindow({
backgroundColor: '#ccc'
imageWin = Ti.UI.createWindow({
width: Ti.UI.FILL,
height: Ti.UI.FILL,
backgroundColor:'#99000000',
opacity: 0
});
var scrollView = Ti.UI.createScrollView({
contentWidth: '100%',
contentHeight: Ti.UI.SIZE,
@dezinezync
dezinezync / s3.node.js
Created October 18, 2012 13:00
Node:S3 policy generator
//Code adapted from https://gist.github.com/2163005
var s3 = {
access_key_id: "<Access Key>"
, secret_key: "<Secret Key>"
, bucket: "<bucket name>"
, acl: "public-read"
, https: "false"
, error_message: ""
, pad: function(n) {
@dezinezync
dezinezync / gist:4034684
Created November 7, 2012 21:40 — forked from daneden/gist:4032573
Sass media queries and @extend
// Fairly safe way to visually hide content, but make it accessible to screen readers
.visually-hidden {
position: absolute;
left: -9999px;
height: 1px;
}
@media screen and (max-width: 700px) {
// Again, accessible to screen readers
// Example: <a href="/login" class="icon icon-twitter"><span class="mobile-offscreen">Single-click </span> log in with Twitter</a>
@dezinezync
dezinezync / gist:4111670
Created November 19, 2012 16:34
Response from API
{"photos":{"page":1, "pages":1, "perpage":80, "total":"48", "photo":[]}, "stat":"ok"}
//FACEPALM. What am I supposed to do with that.
var express = require('express');
var app = express(),
log;
app.configure('development', function() {
app.use(express.errorHandler());
log = {
info:function(e) {
console.log(e);
}
@dezinezync
dezinezync / logentries.stream.js
Last active November 28, 2018 01:04
Streaming Express.logger's output to logentries
var logStream = {
write: function(message,encoding) {
log.info(message.replace('\n', ''));
}
};
//Application's configuration
app.configure(function() {
//Your base config methods
@dezinezync
dezinezync / 976px.grid.less
Last active December 15, 2015 22:49
978px Fixed-width Grid
/*Grid*/
.cover() {
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.myBackground.jpg', sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='myBackground.jpg', sizingMethod='scale')";
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}