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 / post_insert.sql
Created December 12, 2014 19:03
Youtube Vide Tutorial - SQL INSERT
INSERT INTO `posts`(`id`, `title`, `body`, `created`, `modified`)
VALUES (1,'Just a title','Just a post', NOW(),NOW());
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pedro-stanaka
pedro-stanaka / cVimrc.vim
Last active February 7, 2020 10:04
cVim - cVimrc
set autoupdategist
set noautofocus
set nocncpcompletion
set smoothscroll
set hud
set noregex
set noinsertmappings
set typelinkhints
set defaultnewtabpage
@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
@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 / 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; }
#!/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:
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* SchoolsFixture
*
*/
class SchoolsFixture extends TestFixture
//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"
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)