Skip to content

Instantly share code, notes, and snippets.

View jsakhil's full-sized avatar
🎯
Focusing

Js Akhil jsakhil

🎯
Focusing
View GitHub Profile
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@omgmog
omgmog / parallax-scroll.js
Created October 28, 2013 15:26
Simple parallax background scrolling with jQuery
$(function() {
var $el = $('.parallax-background');
$(window).on('scroll', function () {
var scroll = $(document).scrollTop();
$el.css({
'background-position':'50% '+(-.4*scroll)+'px'
});
});
});
@strangerstudios
strangerstudios / my_pmpro_email_data.php
Created January 23, 2014 20:00
Add a !!todaysdate!! variable for use in Paid Memberships Pro email templates. Add this to your active theme's functions.php or a custom plugin and then include !!todaysdate!! in your email templates.
/*
Adds !!todaysdate!! as an available variable for use in Paid Memberships Pro emails.
Notice the array key does not include the !!s
*/
function my_pmpro_email_data($data, $email)
{
$data['todaysdate'] = date(get_option("date_format"));
return $data;
@grandmanitou
grandmanitou / gist:8863248
Created February 7, 2014 14:10
Place multiple markers with infowindow on Google Maps API v3, use external links to trigger click and center map on desired location.
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?language=fra&amp;sensor=false"></script>
<script type="text/javascript">
var map;
var Markers = {};
var infowindow;
var locations = [
[
'Samsung Store Madeleine',
'<strong>Samsung Store Madeleine</strong><p>5 Boulevard Malesherbes, 75008 Paris<br>10h – 20h</p>',
48.8701925,
Handlebars is a semantic web template system, started by Yehuda Katz in 2010.
Handlebars.js is a superset of Mustache, and can render Mustache templates in addition to Handlebars templates.
More: http://handlebarsjs.com/
1. Expressions.
1.1 Basic usage.
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@angrycoffeemonster
angrycoffeemonster / Sublime Text 3 Build 3103 License Key - CRACK
Created April 18, 2016 02:13
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@vovadocent
vovadocent / woo_commerce_usefull.php
Last active June 11, 2021 09:07
Woo Commerce Hooks and Tricks
<?php
////// Rename or remove order statuses //////
function wc_renaming_order_status($order_statuses) {
$order_statuses = array(
'wc-pending' => _x('Pending', 'Order status', 'woocommerce'),
'wc-processing' => _x('New Order', 'Order status', 'woocommerce'),
'wc-cancelled' => _x('Cancelled', 'Order status', 'woocommerce'),
'wc-completed' => _x('Approved', 'Order status', 'woocommerce'),
'wc-on-hold' => _x('On Hold', 'Order status', 'woocommerce'),
<?php
/**
* @license MIT
* @author Ruben Decleyn mukke@tbs-dev.co.uk>
* @created 12/02/2017
*/
namespace App\TwigExtensions;
@sweetleon
sweetleon / ajax.autosave.naive.html
Last active April 14, 2022 09:48
naive AJAX auto-save implementation
<form method="POST" action="/our/url">
<textarea name="input" onChange="save(event)" />
</form>
<script language="javascript">
function save(event) {
var request = new XMLHttpRequest();
request.open(event.target.form.method, event.target.form.action);
request.send(new FormData(event.target.form));
}