Skip to content

Instantly share code, notes, and snippets.

View GianfrancoFrau's full-sized avatar
🌱
growing up

Gianfranco Frau GianfrancoFrau

🌱
growing up
View GitHub Profile
@GianfrancoFrau
GianfrancoFrau / plink-plonk.js
Created February 24, 2020 12:58 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@GianfrancoFrau
GianfrancoFrau / index.html
Created February 14, 2017 10:43 — forked from martinsik/index.html
Simple WebSocket server based on libwebsockets. For full description read http://martinsikora.com/libwebsockets-simple-websocket-server
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
window.WebSocket = window.WebSocket || window.MozWebSocket;
var websocket = new WebSocket('ws://127.0.0.1:9000',
@GianfrancoFrau
GianfrancoFrau / static_server.js
Created December 15, 2016 10:55 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@GianfrancoFrau
GianfrancoFrau / curl.sh
Created July 12, 2016 09:11 — forked from davimacedo/curl.sh
Example of importing data with cloud functions
curl -X POST \
-H "X-Parse-Application-Id: LL9oIdzIkmwl5xyowQQu0fTmXyUWfet9RuAzwHfj" \
-H "X-Parse-REST-API-Key: R3S8PYQKuzeV4c8MUeO5ved46C50MEp56boDHW1O" \
-H "Content-Type: application/json" \
-d @data.json \
https://parseapi.back4app.com/functions/import
var gulp = require('gulp');
var clean = require('gulp-clean');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var bases = {
app: 'app/',
@GianfrancoFrau
GianfrancoFrau / release.sh
Created April 10, 2016 22:18 — forked from edorgeville/release.sh
Creates a signed and zipaligned APK from your Ionic project
#!/bin/bash
#
# Creates a signed and zipaligned APK from your Ionic project
#
# Place your keystore in the root of your project and name it <company>.keystore
# Use this script as following :
# $ ./release.sh [company] [version]
#
# Don't forget to gitignore your key and your compiled apks.
#
@GianfrancoFrau
GianfrancoFrau / node-and-npm-in-30-seconds.sh
Last active September 21, 2015 22:44 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh

Fading Actionbar

This is a quick example of how to create a fading actionbar effect like this in Appcelerator Titanium

fadingactionbar

How this works

This is actually very simple. The trick is putting the Actionbar in overlay mode by configuring the theme with windowActionBarOverlay:true. Then all you need to do is updating the color of the Actionbar, in this case by scrolling a ScrollView.

exports.show = function() {
var win = Ti.UI.createWindow({
title: 'Developer Tools',
layout: 'vertical'
});
win.leftNavButton = Ti.UI.createButton({ title: 'Chiudi' });
win.leftNavButton.addEventListener('click', function() {
(nav || win).close();

Quick Example of registering a scheme in TiApp.xml, implementing the code in app.js / alloy.js