Skip to content

Instantly share code, notes, and snippets.

View pedro-stanaka's full-sized avatar

Pedro Tanaka pedro-stanaka

View GitHub Profile
@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
@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",
"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
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)
//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"
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* SchoolsFixture
*
*/
class SchoolsFixture extends TestFixture
#!/bin/bash
# If there is not a build folder, create it
[ ! -d "build" ] && mkdir build
# Write build files inside build folder
cmake . -B./build
# Build the project using 8 parallel threads
# Let the user input additional parameters like:
@pedro-stanaka
pedro-stanaka / bs-static-site.bash
Last active August 29, 2015 14:17
Bootstrap a new static site - Using Sass + Coffee + HTML5_BP
#!/bin/bash
####
# To use this script I'd recommend installing RVM
#####
# Check dependencies
command -v gem >/dev/null 2>&1 || { echo >&2 "I require rubygems but it's not installed. Aborting."; exit 1; }
command -v git >/dev/null 2>&1 || { echo >&2 "I require git but it's not installed. Aborting."; exit 1; }
@pedro-stanaka
pedro-stanaka / Thorfile.thor
Last active August 29, 2015 14:17
Compiling sass and coffee using Thor and Watchr gems...
ROOT = File.expand_path(File.dirname(__FILE__))
WEBROOT = File.expand_path("../", Dir.pwd)
PRODUCTION = false
COMPASS = true
class Convert < Thor
desc "sass", "converts and puts sass in webroot"
@pedro-stanaka
pedro-stanaka / useful_snippets.sh
Created February 5, 2015 14:17
Useful shell snippets/functions
#!/bin/bash
# Add tex root information to the beginning of each file in directory
for file in src/chapters/*; do; echo $file; echo '% !TEX root =../qualificacao.tex' | cat - $file > temp && mv -f temp $file && rm -f temp; done