Skip to content

Instantly share code, notes, and snippets.

@nuno
nuno / .htaccess
Created February 18, 2014 15:37 — forked from sergejmueller/.htaccess
Extension of the Apache system. Htaccess file for browser-based delivery of WebP instead of JPEG image files. Especially for WordPress. More information about WebP and the snippet shown below http://cup.wpcoder.de/webp-jpeg-alternative/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
</IfModule>
<IfModule mod_headers.c>
Header append Vary Accept env=REDIRECT_accept
</IfModule>
@nuno
nuno / Gruntfile.js
Created January 24, 2014 02:29 — forked from gaspanik/Gruntfile.js
foundation5-grunt-watch-livereload.
/*
Foundation 5 w/ Grunt + Libsass (watch scss/*.scss & .html)
Requirement: Chrome LiveReload extension (https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=en).
Usage: foundation new project-name --libsass && grunt
*/
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@nuno
nuno / app.js
Created January 12, 2014 00:45
Titanium- Control Stuff With Accelerometer
var win = Ti.UI.createWindow();
var ball = Ti.UI.createView({
backgroundColor:'blue',
height:50,
width:50,
borderRadius:20
});
win.add(ball);
@nuno
nuno / JSStyleGuide.md
Created January 12, 2014 00:40
JS Style Guide
@nuno
nuno / Ti.SocialShare.js
Last active January 2, 2016 20:59
Ti.SocialShare sample provided by @raulriera
function shareMessage() {
var shareMessageFull = $.message.text;
var shareMessageEmail = shareMessageFull + "\n\nView more at http://spiritualmixapp.com";
var shareMessageTwitter = shareMessageFull.substring(0, 123) + " via @LiveLoveRaw";
if (OS_ANDROID) {
try {
var intTwitter = Ti.Android.createIntent({
action : Ti.Android.ACTION_SEND,
packageName : "com.twitter.android",
className : "com.twitter.android.PostActivity",
@nuno
nuno / alloy.js
Created December 20, 2013 02:19
FontAwesomeJS for Titanium to be work with: Labels and Buttons. Read first FokkeZB's documentations about the subject, just works :) https://github.com/FokkeZB/FontAwesomeJS
Alloy.Globals.fa = require('fa');
//Application Window Component Constructor
function ApplicationWindow() {
//load component dependencies
var FirstView = require('ui/common/FirstView');
//create component instance
var self = Ti.UI.createWindow({
backgroundColor : '#ffffff',
borderRadius : 6
});
@nuno
nuno / app.js
Created November 14, 2013 16:54 — forked from aaronksaunders/app.js
Using Swipes to open and close windows in a navigation group with titanium appcelerator
//
// Aaron K. Saunders
//
// http://www.clearlyinnovative.com
// http://blog.clearlyinnovative.com
// @aaronksaunders
//
//
(function() {
var group, tab1, tab2, win1, win2;
/**
* @aaronksaunders
*
* See more Appcelerator Information on Company Blog
* blog.clearlyinnovetiove.com
*
*/
var TiParse = function(options) {
FB = {
init: function() {
@nuno
nuno / TiDocs.sh
Created November 3, 2013 12:53 — forked from eric-hu/TiDocs.sh
#! /bin/sh
# Run this from the folder you want to be the parent of your docs
# By default, generated docs go into
# titanium_mobile/dist/apidoc/ti_mobile_docs/
#
# This can be changed below
git clone https://github.com/appcelerator/titanium_mobile.git
cd titanium_mobile
sudo apt-get install python-setuptools python-dev