Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
Stay well, Stay home

Bruno Fernando dos Santos Silva 3runoDesign

🏡
Stay well, Stay home
View GitHub Profile
@tillsanders
tillsanders / intro.markdown
Last active Sep 7, 2020
Laravel: drag-and-drop repositioning with auto-save of DB entries
View intro.markdown

Laravel: drag-and-drop repositioning with auto-save of DB entries

Use case: Database entries are represented in a table. By grabbing and moving a row up or down the table, you can change the entries' order/position. The changes are submitted automatically via ajax.

  • Uses jQueryUI (custom download: sortable is needed)
  • newly created elements are added to the top (see route /jobs/create)
@rufhausen
rufhausen / homestead_extras.sh
Last active Mar 15, 2017
My script for adding some "extras" (LDAP, Oracle, MSSQL, Oh-My-Zsh, etc.) to a Laravel Homestead Vagrant VM.
View homestead_extras.sh
#!/bin/bash
apt-get update
#Additional Packages
apt-get install -y cifs-utils winbind smbclient bindfs gvfs gvfs-bin keyutils unzip php5-ldap php5-mssql zsh
wget --no-check-certificate http://install.ohmyz.sh -O - | sh
chsh vagrant -s /bin/zsh
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active Jan 18, 2021
A comparison of using `git flow` commands versus raw `git` commands.
View gitflow-breakdown.md

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@fdaciuk
fdaciuk / Adicionar novo campo (custom field) a uma taxonomia (categoria, tag, etc) no WordPress.md
Last active Feb 19, 2019
Adicionar novo campo (custom field) a uma taxonomia no WordPress (Incluir esse código no functions.php)Nas action_hooks, no lugar de "category" é só incluir o slug da sua taxonomia :)
View Adicionar novo campo (custom field) a uma taxonomia (categoria, tag, etc) no WordPress.md

Adicionar novo campo (custom field) a uma taxonomia (categoria, tag, etc) no WordPress

Incluir esse código no functions.php.

Nas action_hooks, no lugar de "category" é só incluir o slug da sua taxonomia :)

@unfulvio
unfulvio / functions.php
Last active Apr 27, 2020
WordPress HTML Minification Class to compress HTML (removal of whitespaces, line breaks, new lines, comments). Preserves script comments (if removed might break some javascripts like Google Analytics or Adsense) and IE specific tags.
View functions.php
/* Minifies HTML and removes comments (except IE tags and comments within script tags)
*
* To disable compression of code portions, use '<!--wp-html-compression no compression-->' tag
*
* @see http://forrst.com/posts/Wordpress_Minify_output_HTML-29q
* @see http://www.intert3chmedia.net/2011/12/minify-html-javascript-css-without.html
*/
class WP_HTML_Compression
{
// Settings
@rachelbaker
rachelbaker / install-yeoman-osx.md
Last active Oct 4, 2019
Instructions for installing Node NPM and Yeoman on OSX
View install-yeoman-osx.md
@zenorocha
zenorocha / multiple-3rd-party-widgets.js
Last active Dec 12, 2020
Loading multiple 3rd party widgets asynchronously
View multiple-3rd-party-widgets.js
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);
@fjaguero
fjaguero / opengraph-wordpress.php
Created Oct 17, 2012
Add Facebook Open Graph Meta Data to Wordpress
View opengraph-wordpress.php
//Adding the Open Graph in the Language Attributes - functions.php
function add_opengraph_doctype( $output ) {
return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';
}
add_filter('language_attributes', 'add_opengraph_doctype');
//Lets add Open Graph Meta Info
function insert_fb_in_head() {
@letanure
letanure / estados-cidades.json
Last active Jan 17, 2021
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
View estados-cidades.json
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
You can’t perform that action at this time.