Skip to content

Instantly share code, notes, and snippets.

View 3runoDesign's full-sized avatar
🏡
Stay well, Stay home

Bruno Fernando dos Santos Silva 3runoDesign

🏡
Stay well, Stay home
View GitHub Profile
@lucasprogamer
lucasprogamer / .htacess
Last active November 25, 2022 23:28
Add after # END WordPress.
#Força a utilizar Cache-Control e Expires header
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Html
@fjaguero
fjaguero / opengraph-wordpress.php
Created October 17, 2012 08:32
Add Facebook Open Graph Meta Data to Wordpress
//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() {
@zenorocha
zenorocha / multiple-3rd-party-widgets.js
Last active November 14, 2022 12:18
Loading multiple 3rd party widgets asynchronously
(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);
@3runoDesign
3runoDesign / AppDelegate.m
Created January 7, 2022 02:28
Print Font Names on IOS
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// ...
for (NSString* family in [UIFont familyNames])
{
NSLog(@"%@", family);
for (NSString* name in [UIFont fontNamesForFamilyName: family])
{
NSLog(@" %@", name);
@rufhausen
rufhausen / homestead_extras.sh
Last active August 11, 2021 03:33
My script for adding some "extras" (LDAP, Oracle, MSSQL, Oh-My-Zsh, etc.) to a Laravel Homestead Vagrant VM.
#!/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
@unfulvio
unfulvio / functions.php
Last active July 15, 2021 05:17
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.
/* 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
@tillsanders
tillsanders / intro.markdown
Last active June 24, 2021 20:17
Laravel: drag-and-drop repositioning with auto-save of DB entries

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)
@timkinnane
timkinnane / dynamic_image_downsize.php
Created February 2, 2015 08:49
Filter the output of image_downsize() to return dynamically generated images for intermediate or inline sizes. Long description in php doc block.
<?php
/**
* Filter the output of image_downsize() to return dynamically generated images for intermediate or inline sizes.
*
* <p>Because Wordpress generates all image sizes on first upload, if you change
* theme or size settings after the upload, there won't be a matching file for
* the requested size.<br/>
* This filter addresses the problem of the default downsize process laoding
* a large file and scaling it down in the browser if it doesn't find the right
* size image. This can cause large files to be loaded unnecessarily and will
@rachelbaker
rachelbaker / install-yeoman-osx.md
Last active October 4, 2019 21:33
Instructions for installing Node NPM and Yeoman on OSX