Skip to content

Instantly share code, notes, and snippets.

View nicomollet's full-sized avatar

Nico Mollet nicomollet

View GitHub Profile
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]: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
@finger-berlin
finger-berlin / smb.conf
Created May 9, 2012 08:52
smb.conf for simple /var/www sharing ... make sure /var/www is owned by www-data...
[global]
unix charset = UTF8
workgroup = XXX
netbios name = XXX
server string = %h server (Samba, Ubuntu)
interfaces = lo eth0
bind interfaces only = Yes
security = SHARE
obey pam restrictions = Yes
guest account = www-data
@claviska
claviska / pretty-buttons.less
Last active October 21, 2022 22:25
A Less mixin' for pretty buttons with Bootstrap 3
.pretty-buttons(@color, @background, @text-shadow: none) {
color: @color;
#gradient > .vertical(lighten(@background, 5%), darken(@background, 5%), 0%, 100%);
border-color: darken(@background, 10%);
border-bottom-color: darken(@background, 20%);
text-shadow: @text-shadow;
.box-shadow(inset 0 1px 0 rgba(255, 255, 255, .1));
&:hover,
@DevinVinson
DevinVinson / Unset woocommerce gateway for specific country
Created August 15, 2013 04:53
Remove woocommerce gateways for $country, remove gateways for anything else
function lk_aussie_gateways( $available_gateways ) {
global $woocommerce;
if ($woocommerce->customer->get_country() == 'AU') {
unset( $available_gateways['cod'] );
}
return $available_gateways;
@fidelix
fidelix / settings.local.php
Last active January 3, 2016 05:50
Development settings file for Drupal 7
<?php
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'meusite_local',
'username' => 'root',
'password' => 'root',
'host' => 'localhost',
@JodiWarren
JodiWarren / gravityforms.scss
Created January 20, 2014 12:00
Style Gravity Forms with Bootstrap 3 (SASS) - From: http://roots.io/style-gravity-forms-with-bootstrap/
.gform_wrapper ul {
@extend .list-unstyled;
}
.gform_wrapper li {
@extend .form-group;
}
.gform_wrapper form {
margin-bottom: 0;
}
.gform_wrapper .gfield_required {
@raddevon
raddevon / openAnchorAccordion.js
Last active April 1, 2020 19:50
Open a Bootstrap accordion control if its anchor is target on page load
// Opens accordion automatically if an accordion target is accessed from another page
// Assumes the accordion-group is the target linked to
function openAnchorAccordion() {
if (window.location.hash) {
var $target = $('body').find(window.location.hash);
if ($target.hasClass('accordion-group')) {
var $targetAccordion = $target.find('.collapse');
$targetAccordion.collapse('show');
}
}
@raucao
raucao / typekit.js
Last active February 12, 2020 06:25
Improved Typekit embed code
(function(d) {
var tkTimeout=3000;
if(window.sessionStorage){if(sessionStorage.getItem('useTypekit')==='false'){tkTimeout=0;}}
var config = {
kitId: 'a1b2c3f4',
scriptTimeout: tkTimeout
},
h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";if(window.sessionStorage){sessionStorage.setItem("useTypekit","false")}},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='//use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
})(document);
@jeherve
jeherve / plugin.php
Created February 28, 2014 18:19
[Jetpack] Related Posts: retrieve Related Posts manually, and return post titles
<?php
function jeherve_custom_related( $atts ) {
$posts_titles = array();
if ( class_exists( 'Jetpack_RelatedPosts' ) && method_exists( 'Jetpack_RelatedPosts', 'init_raw' ) ) {
$related = Jetpack_RelatedPosts::init_raw()
->set_query_name( 'jeherve-shortcode' ) // Optional, name can be anything
->get_for_post_id(
get_the_ID(),
array( 'size' => 3 )
@salcode
salcode / .gitignore
Last active December 10, 2024 15:31
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore