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
/*
Place this file in your /lib directory.
Require geo in calling module like var geo = require("geo"); Then call geo.init() at the start of your app.
To get current location, place a fireEvent at the start of your app and anywhere else location needs updating like this:
Ti.App.addEventListener('resume', function() {
Ti.App.fireEvent('getCurrentPosition');
});
@author Michael Stelly, et al.
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
var crypto = require("crypto")
, util = require("util")
, express = require("express");
var s3 = {
access_key_id: "<access_key>"
, secret_key: "<your_secret_key>"
, bucket: "<your_bucket>"
, acl: "public-read"
, https: "false"
(function($) {
$.fn.textfill = function(maxFontSize) {
maxFontSize = parseInt(maxFontSize, 10);
return this.each(function(){
var ourText = $("span", this),
parent = ourText.parent(),
maxHeight = parent.height(),
maxWidth = parent.width(),
fontSize = parseInt(ourText.css("fontSize"), 10),
multiplier = maxWidth/ourText.width(),
CSS Layout Debugger
=====================
A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
**One-line version to paste in your DevTools**
Use `$$` if your browser aliases it:
~ 108 byte version
#!/usr/bin/env bash
# login as root and run this script via bash & curl:
apt-get update
apt-get install -y build-essential bison openssl libreadline5 libreadline5-dev curl \
git-core zlib1g zlib1g-dev libopenssl-ruby libcurl4-openssl-dev libssl-dev \
libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev \
mysql-client mysql-server
#!/bin/sh
#
# chkconfig: 35 99 99
# description: Node.js /home/nodejs/sample/app.js
#
. /etc/rc.d/init.d/functions
USER="nodejs"
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
# This is the free sample of .htaccess from 6GO s.r.l.
# @author Claudio Ludovico Panetta (@Ludo237)

Selettore X Y

Esempio “ li a { border:none; }

Indica che lo stile verrà attribuito a tutti i discendenti del primo selettore, si può fare con #ID o anche con .classi o con del semplice html (vedi esempio) attenzione se la lista si prolunga troppo tipo “div ol li a.classe#id” evidentemente stai sbagliando qualcosa! Massimo due o tre selettori.

Selettore X+Y

Esempio “li + a {border:none;}

Indica che lo stile verrà applicato al selettore adiacente più prossimo a quello padre, in questo caso al primo tag "a" subito dopo "li".

Selettore X > Y

Esempio “div#container > li > a {border: none}