# html5 pushstate (history) support: | |
<ifModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !index | |
RewriteRule (.*) index.html [L,QSA] | |
</ifModule> |
#!/bin/bash | |
set -o errexit | |
git filter-branch --tree-filter "git rm -r -f --ignore-unmatch *.psd" HEAD | |
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune |
document.getElementsByTagName('button')[0].onclick = function () { | |
scrollTo(document.body, 0, 1250); | |
} | |
function scrollTo(element, to, duration) { | |
var start = element.scrollTop, | |
change = to - start, | |
currentTime = 0, | |
increment = 20; | |
<?php | |
/** | |
* start the customisation | |
*/ | |
function custom_woo_before_shop_link() { | |
add_filter('woocommerce_loop_add_to_cart_link', 'custom_woo_loop_add_to_cart_link', 10, 2); | |
add_action('woocommerce_after_shop_loop', 'custom_woo_after_shop_loop'); | |
} | |
add_action('woocommerce_before_shop_loop', 'custom_woo_before_shop_link'); |
var today = new Date(); // By default brings backs tweets only in the last hour. Or just use new Date('Fri Jul 05 13:35:22 +0000 2013'), with a fixed cut off time, to have tweets within the specified time-frame only | |
// If you do not want the hourly window to change (otherwise "today" will become a moving target of tweets in the last hour each time tweet counter runs, then please put this line at the top of the file, inside the .ready function as follows: | |
// $(document).ready(function(){ var today = new Date(); }) | |
// Making sure that the variable is defined outside of the var tweetCounter function | |
// Lets go through each tweet | |
for (obj in data.statuses) { | |
var tw_result = data.statuses[obj]; // This is the tweet | |
var tw_unique_id = tw_result.id_str; // This is the id of the tweet |
Just like you I am extremely excited about the release of [Newscoop 4.2] and the new [Symfony Bundles] plugin system. In the following few steps I will demonstrate to you how to get started creating a super simple Plugin for [Newscoop 4.2].
- Motivation (we won't get anywhere if you don't have this!)
- Your favourite code editor
- Git client
- (S)FTP Client for connecting to your server
- Some knowledge of how to use the Terminal
/*global $:false, window:false */ | |
/** | |
* Load google maps asynchonously and return a function | |
* to wrap around a callback function for when google | |
* maps finishes loading. | |
* | |
* Note: need to load jQuery 1.5+ before this module | |
* is loaded. | |
* |
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
/*! | |
* JavaScript - loadGoogleMaps( version, apiKey, language ) | |
* | |
* - Load Google Maps API using jQuery Deferred. | |
* Useful if you want to only load the Google Maps API on-demand. | |
* - Requires jQuery 1.5 | |
* | |
* Copyright (c) 2011 Glenn Baker | |
* Dual licensed under the MIT and GPL licenses. | |
*/ |