Skip to content

Instantly share code, notes, and snippets.

View larodiel's full-sized avatar

Victor Larodiel larodiel

View GitHub Profile
@adamesque
adamesque / preloader.js
Created February 16, 2011 23:38
Uses jQuery's new Deferred object to help with image loading
/**
* Helper function for passing arrays of promises to $.when
*/
jQuery.whenArray = function ( array ) {
return jQuery.when.apply( this, array );
};
/**
* Accepts a single image src or an array of image srcs.
@sjkp
sjkp / sp2013 include reputation
Last active March 17, 2021 10:44
SharePoint 2013, how to enable like/unlike functionality by client side javascript on a publishing pagelayout. - Requirements, like functionality is enabled on the page library. - You must include reputation.js if you are wrapping this in a webcontrol, that can e.g. be done with: ScriptLink.RegisterScriptAfterUI(this.Page, "reputation.js", false);
<%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<SharePointWebControls:ScriptLink language="javascript" name="reputation.js" OnDemand="false" LoadAfterUI="true" runat="server" Localizable="false" />
@LucaRosaldi
LucaRosaldi / wp-searchform.php
Last active April 19, 2019 21:57
WP: Search Form in Microdata Format
<?php
/**
* The search form in Microdata format.
*
* This is used by Google to display a fully functional
* search bar in the search results for your website,
* directly below the title.
*
* @link https://developers.google.com/webmasters/structured-data/slsb-overview
*/
@jchamb
jchamb / gist:fdf7d12b0191cb852056
Last active July 25, 2023 16:59
Woocommerce Free Downloads without checkout
function direct_free_downloads_button($button)
{
global $product;
if( $product->is_downloadable() AND $product->get_price() == 0 )
{
$files = $product->get_files();
$files = array_keys($files);
$download_url = home_url('?download_file='.$product->id.'&key='.$files[0].'&free=1' );
@adrianhall
adrianhall / .eslintrc.js
Last active April 29, 2024 15:01
A sample .eslintrc file
var OFF = 0, WARN = 1, ERROR = 2;
module.exports = exports = {
"env": {
"es6": true
},
"ecmaFeatures": {
// env=es6 doesn't include modules, which we are using
"modules": true
@zhiguangwang
zhiguangwang / README.md
Last active June 8, 2024 00:55
Disable and Enable kdc on Mac OS X

If you don't like or need the kdc process on Mac OS X, which opens TCP port 88 to the world, you can disable it with launchctl.

Disable:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.Kerberos.kdc.plist

Enable:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.Kerberos.kdc.plist