Skip to content

Instantly share code, notes, and snippets.

@bytefade
bytefade / adobe-font.sh
Created April 16, 2015 00:09
Install font source code pro in ubunt via terminal
#!/bin/bash
mkdir /tmp/adodefont
cd /tmp/adodefont
wget https://github.com/adobe-fonts/source-code-pro/archive/1.017R.zip
unzip 1.017R.zip
mkdir -p ~/.fonts
cp source-code-pro-1.017R/OTF/*.otf ~/.fonts
fc-cache -f -v
@bytefade
bytefade / contains.js
Created April 29, 2015 14:26
Make jQuery :contains Case-Insensitive
// jquery > 1.8
$.expr[":"].contains = $.expr.createPseudo(function(arg) {
return function( elem ) {
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
};
});
//---uso
$("div:contains('John')")
@bytefade
bytefade / find_table.js
Created April 29, 2015 14:29
find table - busca rapida em tabelas de html
$( document ).ready(function() {
// Handler for .ready() called.
$("#textFind").keyup(function()
{
$('tbody').css('display', 'block');
$('table.table tbody tr td').removeClass('marcado');
$('table.table tbody tr').removeClass('remover');
stringPesquisa = $("#textFind").val();
# Local Dates:
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt
# ISO Dates:
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt
#!/bin/sh
# Sublime Text 3 install with Package Control (last update: 4 April 2015)
#
# No need to download this script, just run it on your terminal:
#
# $ curl -L git.io/sublimetext | sh
#
# When you need to update Sublime Text, run this script again.
<?php
# Load slim WP
define( 'WP_USE_THEMES', false );
require( './wp-load.php' );
# http://phpexcel.codeplex.com/
require_once dirname(__FILE__) . '/Classes/PHPExcel.php';
global $wpdb;
$query = "SELECT * FROM $wpdb->comments
@bytefade
bytefade / replaceSQL.sql
Created June 1, 2015 13:50
Replace direto via SQL
update table1
set phone = replace(phone, '-', '');
@bytefade
bytefade / git-stash
Created June 19, 2015 17:57
Git stash, quando você trabalha em branch errado.
$ git stash
$ git stash branch temporario
$ git checkout nova-consulta
$ git merge --no-ff temporario
$ git branch -d temporario
Com o git stash eu peguei minhas mexidas e guardei em lugar seguro. Nisso, o master voltou a ficar com o conteúdo correto. Ufa!
Com o git stash branch temporario eu criei um branch com elas, de nome temporario.
Com o git checkout eu entrei no branch correto, nova-consulta
Com o git merge eu peguei a minha mexida, que agora está no branch temporario, e incorporei ao branch correto (nova-consulta) :-)
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_delay": 5,
"auto_complete_selector": "source - comment",
"auto_complete_size_limit": 4194304,
"auto_complete_triggers":
[
{
"characters": "<",
@bytefade
bytefade / sublime.config
Created June 27, 2015 22:11
sublime packege
{
"auto_upgrade_last_run": null,
"in_process_packages":
[
],
"installed_packages":
[
"AdvancedNewFile",
"All Autocomplete",
"Alternative Autocompletion",