Skip to content

Instantly share code, notes, and snippets.

@deyvisonrocha
deyvisonrocha / 0_reuse_code.js
Created April 17, 2014 14:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
https://itunes.apple.com/us/app/sourcedrop/id520820413?mt=12&ign-mpt=uo%3D4
@deyvisonrocha
deyvisonrocha / example.php
Created July 29, 2015 20:43
Exemplo código Ajax.
<?php
$connect = mysql_connect('localhost', 'root', 'root');
?>
@deyvisonrocha
deyvisonrocha / mysql_backup_script.sh
Created May 19, 2016 12:53
MySQL - Script de Backup
#!/bin/bash
#################### SCRIPT PARA BACKUP MYSQL ####################
# Jeferson R. Costa <rc.jeferson@gmail.com> #
# Created Feb, 2013 #
# Update Feb, 2013 #
# Definindo parametros do MySQL
echo " -- Definindo parametros do MySQL ..."
DB_NAME='dbname'
@deyvisonrocha
deyvisonrocha / setVarInBlade.php
Last active August 2, 2016 20:20
Create a extend command on Blade for Laravel 4.
<?php
/*
|--------------------------------------------------------------------------
| Extend blade so we can define a variable
| <code>
| @define $variable = "whatever"
| </code>
|--------------------------------------------------------------------------
*/
@deyvisonrocha
deyvisonrocha / config.md
Created December 14, 2017 20:27
Linux + Visual Studio Code + Docker

Configurations

php.ini file configuration to docker:

xdebug.idekey = "VSCODE"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_port = 9000
xdebug.remote_host = 
@deyvisonrocha
deyvisonrocha / telegram-accent-elementary.md
Last active March 23, 2018 02:05
Telegram accent on Elementary OS 0.4

telegramdesktop/tdesktop#1360 (comment)

This works for me on elementary OS 0.3 and 0.4

You should have ibus-unikey installed, if you don't do it with this command:

sudo apt-get install ibus-unikey

Now configure ibus through ibus-setup. To do this, run the command on a terminal and go to the input method tab.

@deyvisonrocha
deyvisonrocha / digitalocean.md
Last active April 22, 2018 13:12
Digital Ocean - Passo a passo para criar uma VPS
@deyvisonrocha
deyvisonrocha / post-merge
Created May 24, 2018 12:51 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@deyvisonrocha
deyvisonrocha / post-merge
Created May 24, 2018 12:53 — forked from GianlucaGuarini/post-merge
Git hook that gets triggered after any 'git pull' whenever one of the files specified has changed. Useful to update any web application dependency using bower npm or composer
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep -E --quiet "$1" && eval "$2"
}