Skip to content

Instantly share code, notes, and snippets.

@jonnyreeves
jonnyreeves / index.html
Created April 23, 2012 21:38
JavaScript Class Structure using requireJS. The following code shows you how to create a Class definition in one JavaScript file and then import it for use in another; coming from an ActionScript 3 background this (and some of JavaScript specific traits)
<!DOCTYPE html>
<html>
<head>
<script data-main="usage" src="http://requirejs.org/docs/release/1.0.8/comments/require.js"></script>
</head>
<body>
<p>Check your JavaScript console for output!</p>
</body>
</head>
@ronan-gloo
ronan-gloo / gist:3550934
Created August 31, 2012 09:45
Fancybox html5 video iframe fullscreen
$('.fancybox').fancybox({
afterLoad: function(e) {
$(e.inner).find('iframe').attr({
'webkitallowfullscreen': true,
'mozallowfullscreen': true
});
}
});
@kosinix
kosinix / custom-nav-walker-usage.php
Last active April 25, 2023 09:32
WordPress: Using a custom nav walker to create navigation menus in plain <a> tags. That is the <ul> and <li> tags are not present. Very useful if you want to create simple links that can be centered with a simple text-align:center on the containing element.
<?php
// In your template files like footer.php
// The items_wrap value ('%3$s') removes the wrapping <ul>, while the custom walker (Nav_Footer_Walker) removes the <li>'s.
wp_nav_menu(array('items_wrap'=> '%3$s', 'walker' => new Nav_Footer_Walker(), 'container'=>false, 'menu_class' => '', 'theme_location'=>'footer', 'fallback_cb'=>false ));
?>
@prime31
prime31 / gist:5675017
Last active May 28, 2024 11:37
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@ixrevo
ixrevo / WordPress Development .gitignore
Last active March 9, 2022 01:50
.gitignore file for setting up the WordPress development environment.
########################
# Wordpress Core files #
########################
wp-admin/
wp-content/backups/
wp-content/blogs.dir/
wp-content/languages/
wp-content/index.php
wp-content/themes/index.php
wp-includes/
@d3noob
d3noob / .block
Last active October 21, 2023 12:33
D3.js tree diagram generated from external (JSON) data
license: mit
@jbruni
jbruni / master.blade.php.html
Last active September 23, 2016 07:35
"index.html" template - Blade/Laravel/PHP (back-end) AngularJS/RequireJS/Mimosa (front-end)
<!DOCTYPE html>
<html class="no-js{{ empty($class) ? '' : ' ' . $class }}" lang="pt-br" xmlns:ng="http://angularjs.org" id="ng-app">
<head>
<title>{{ empty($title) ? '' : $title . ' | ' }}{{ Config::get('business.site_name') }}</title>
<!-- Meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="robots" content="index, follow">
@lmartins
lmartins / functions.php
Last active November 3, 2023 19:28 — forked from woogist/functions.php
By default WooCommerce redirects the user to the My Account page after a successful login. You may change this and use a custom URL based on the user role, like the Dashboard for admins and My Account page for customers. To do this, add this code at the end of the file functions.php located in wp-content/themes/your-theme-name/ https://support.w…
<?php
/**
* Redirect users to custom URL based on their role after login
*
* @param string $redirect
* @param object $user
* @return string
*/
function wc_custom_user_redirect( $redirect, $user ) {
// Get the first of all the roles assigned to the user
@voluntas
voluntas / new_to_mqtt.rst
Last active October 2, 2023 06:26
初めての MQTT
@jaceju
jaceju / web_development_with_laravel_5.md
Last active July 12, 2023 06:34
Laravel 5 測試起手式

Web Development with Laravel 5

目標

如何在開發的過程中加入測試。

  1. Model
  2. Repository
  3. Controller
  4. Auth