This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Awesome2DCamera : MonoBehaviour { | |
// the target the camera should follow (usually the player) | |
public Transform target; | |
// the camera distance (z position) | |
public float distance = -10f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TERREMOTO NO CEARÁ | |
O Governo Brasileiro instalou um sistema de medição e controle de abalos sísmicos no país. O Centro Sísmico Nacional, poucos dias após entrar em funcionamento, já detectou que haveria um grande terremoto no Nordeste. | |
Assim, enviou um telegrama à delegacia de polícia de Icó, no Ceará, com a seguinte mensagem: | |
"Urgente. | |
Possível movimento sísmico na zona. | |
Muito perigoso. 7 na escala Richter. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ipAddress=$_SERVER['REMOTE_ADDR']; | |
#run the external command, break output into lines | |
$result = `arp -n $ipAddress`; | |
// $result expample '? (192.168.1.9) at e0:f8:47:2a:12:b8 on en1 ifscope permanent [ethernet]' | |
// using explode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dynamic call for ajax forms using jQuery | |
// <form method='post' data-async="true" data-callback="functionName" > callback function | |
// <form method='post' data-async="true" data-callback="Object.mehodName" > callback object method | |
// will send 3 params to callback function: form, data, result | |
$('body').on('submit', 'form[data-async]', function(e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! $1 ]; then | |
echo " It uses 3 parameters: [import|export] [database_name] [dir_to_store|dir_to_import]" | |
echo " Example of use:" | |
echo " ./mongo.sh export my_database dump/" | |
echo " ./mongo.sh import my_database dump/" | |
exit 1 | |
fi | |
operation=$1 | |
db=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
trait Broga | |
{ | |
public function andar() | |
{ | |
echo 'broga anda...'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SITE_DOMAIN="terraqueos.local" | |
# update | |
echo "===Updating....===" | |
apt-get update | |
# install the default things | |
echo "===Install the default stuff...===" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("img").each(function(index, value){ | |
var $img = $(value), | |
src = $img.attr('src'), | |
w = 0; | |
h = 0; | |
if( src.search('.gif') !== -1){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# Expires headers (for better cache control) | |
# ---------------------------------------------------------------------- | |
# | |
# These are pretty far-future expires headers | |
# They assume you control versioning with cachebusting query params like: | |
# <script src="application.js?20100608"> | |
# Additionally, consider that outdated proxies may miscache | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// path to image folder | |
$folder = dirname(__FILE__); | |
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($folder)) as $filename) | |
{ | |
// check if is not file | |
if(!is_file($filename)) | |
continue; |