Skip to content

Instantly share code, notes, and snippets.

View pedro-stanaka's full-sized avatar

Pedro Tanaka pedro-stanaka

View GitHub Profile
//In config/bootstrap.php
/**
* Set the default locale. This controls how dates, number and currency is
* formatted and sets the default language to use for translations.
*/
ini_set('intl.default_locale', 'pt_BR');
// Part of my po file in: src/Locale/pt_BR
msgid "Actions"
@pedro-stanaka
pedro-stanaka / rmsvn.sh
Created June 14, 2013 02:07
Remove all SVN(eww) metadata folders recursivelly under the current directory. Usefull to move a svn_repo to a Git repo.
#!/bin/sh
echo "recursively removing .svn folders from"
pwd
rm -rf `find . -type d -name .svn`
@pedro-stanaka
pedro-stanaka / Makefile
Created June 18, 2013 12:36
Makefile for OpenGL programming in UNIX systems using the library freeglut3.
CPP = g++
CC = gcc
OBJ = main.o $(RES)
BIN = appname
RM = rm -f
PROGRAM = appname
$(PROGRAM):
$(CPP) -w *.cpp -lX11 -lGL -lGLU -lglut -g -Wall -O2 -o $(PROGRAM)
@pedro-stanaka
pedro-stanaka / blog.test
Created December 6, 2013 21:47
VHOST FOR CAKE BLOG
<VirtualHost *:80>
ServerName blog.local
ServerAdmin pedro.tanaka@sinetic.com.br
DocumentRoot /var/www/repos/blog.cake
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/repos/blog.cake>
@pedro-stanaka
pedro-stanaka / git-config.sh
Last active January 2, 2016 14:19
Git configuration with prompts. Shell (Bash) script for Debian/Based distros of Linux.
#!/bin/bash
command -v git >/dev/null 2>&1 || { echo >&2 "Git is not installed. Aborting."; exit 1; }
echo "\nWhat name should be used in commits globally? \n"
read full_name
git config --global user.name "$full_name"
@pedro-stanaka
pedro-stanaka / upgrade-php5.sh
Created January 8, 2014 16:18
Update PHP on Ubuntu 12.04 to 5.4 version with mcrypt extension; These are dependencies of CakePHP 3.0
#!/bin/bash
# Install aptitude a better package manager than apt-get
# and install the apt-add-repository command
sudo apt-get install aptitude python-software-properties
# Add the ppa that has the oldstable version of PHP5
sudo apt-add-repository ppa:ondrej/php5-oldstable -y
def convert(in_file, out_file):
name = ""
for line in in_file:
line = line.strip()
print(line)
if line == "":
continue
if line.startswith('"'):
name = line.strip('"')
print("NAME:: " + name)
"LCM"
0.2 67223.5
0.3 57739.8
0.4 26998.7
0.5 17645.0
0.6 12286.6
0.7 9280.72
0.8 7321.65
0.9 5972.66
@pedro-stanaka
pedro-stanaka / locations.json
Last active May 17, 2016 20:58
Inserting positions from Google Location History on CouchBase
{
"locations" : [ {
"timestampMs" : "1463503818004",
"latitudeE7" : -233295844,
"longitudeE7" : -511776429,
"accuracy" : 38,
"activitys" : [ {
"timestampMs" : "1463503813318",
"activities" : [ {
"type" : "still",
@pedro-stanaka
pedro-stanaka / .gitignore
Last active June 13, 2016 13:41 — forked from superscott/kafka
Simple Kafka Ubuntu init.d Startup Script
# Created by https://www.gitignore.io/api/windows
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini