Skip to content

Instantly share code, notes, and snippets.

View vicenterusso's full-sized avatar
🛠️
Mastering the art of DevOps

Vicente Russo vicenterusso

🛠️
Mastering the art of DevOps
View GitHub Profile
@vicenterusso
vicenterusso / Yii join
Created August 19, 2013 14:29
Yii join
$rows = Yii::app()->db->createCommand()
->select('j.*, p.orderno, p.category, o.bidno')
->from('jobs j')
->join('projects p','j.projid = p.projid')
->join('orders o', 'p.orderno = o.orderno')
->where('j.projid=:id', array(':id'=>$id))
->order('j.jobno,j.projid')
->queryRow();
// Credit to damien_oconnell from http://forum.unity3d.com/threads/39513-Click-drag-camera-movement
// for using the mouse displacement for calculating the amount of camera movement and panning code.
using UnityEngine;
using System.Collections;
public class MoveCamera : MonoBehaviour
{
//
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@vicenterusso
vicenterusso / sublimetext3.reg
Created September 22, 2014 03:28
Sublime Text 3 - Context Menu - Open Folder
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\sublime]
@="Open Folder as &Sublime Project"
[HKEY_CLASSES_ROOT\Directory\shell\sublime\command]
@="\"C:\\Program Files\\Sublime Text 3\\sublime_text.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\sublime]
@="Open Folder as &Sublime Project"

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
@vicenterusso
vicenterusso / CSV LocalizeAll
Last active October 1, 2015 16:00
Unity3D I2 Localization snippet for CSV
#if EXTERNALTRANSLATION
var CSVstring = File.ReadAllText(Application.streamingAssetsPath + "/lang.csv");
CSVstring=CSVstring.Replace(";", ",");
Debug.Log(LocalizationManager.CurrentLanguage);
LocalizationManager.Sources[0].Import_CSV(string.Empty, CSVstring, eSpreadsheetUpdateMode.Replace, ';');
LocalizationManager.CurrentLanguage = LocalizationManager.Sources[0].mLanguages[0].Name;
LocalizationManager.LocalizeAll();
#endif
@vicenterusso
vicenterusso / Unity3D - Editor Script Boilerplate
Created September 18, 2015 00:29
Generic boilerplate for custom inspector
using System;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MyScript))]
public class MyScriptEditor : Editor
{
private MyScript _script;
void OnEnable()
@vicenterusso
vicenterusso / Installing wkhtmltopdf Ubuntu 14.04
Last active February 1, 2017 09:29
Installing wkhtmltopdf Ubuntu 14.04
Steps:
At first install xvfb serwer:
$ sudo apt-get install xvfb
Get needed version of wkhtmltopdf from http://wkhtmltopdf.org/downloads.html For ubuntu 14.04 64-bit:
$ wget http://downloads.sourceforge.net/project/wkhtmltopdf/archive/0.12.1/wkhtmltox-0.12.1_linux-trusty-i386.deb
Install wkhtmltopdf:
@vicenterusso
vicenterusso / README.md
Created December 4, 2015 13:37
Automatic Semantic Versioning via Git Tags

This function automatically grabs the latest git tag and, based on keyword (major, minor, patch), adds a new tag. (e.g. git_tag patch for v1.2.0 would create v1.2.1)

Drop this into your ~/.bash_profile and run source ~/.bash_profile to use it.

You can find all of my dotfiles here: https://github.com/drewbarontini/dotfiles

Credit to Jacob Swanner for cleaning up my function :)

@vicenterusso
vicenterusso / PhysicsEvents2D.cs
Created December 9, 2015 15:18
PhysicsEvents2D from @melvmay
using System;
using UnityEngine;
using UnityEngine.Events;
public class PhysicsEvents2D : MonoBehaviour
{
[Serializable]
public class CollisionEnterEvent : UnityEvent<Collision2D> { }
[Serializable]