Skip to content

Instantly share code, notes, and snippets.

@tuckbloor
tuckbloor / index.html
Created October 26, 2016 20:13
Datatables working inside jquery ui tabs
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Datatables</title>
<script type="text/javascript" src="http://www.codecaven.co.uk/js/jquery.js"></script>
<script type="text/javascript" src="http://www.codecaven.co.uk/js/jquery.snippet.min.js"></script>
<style type="text/css" title="currentStyle">
@import "http://www.codecaven.co.uk/media/css/demo_page.css";
@import "http://www.codecaven.co.uk/media/css/demo_table.css";
@tuckbloor
tuckbloor / index.html
Created October 26, 2016 20:10
Google maps enter your postcode and it will give you directions to a preset postcode
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps Postcode To Destination Working Example</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/standard.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
@tuckbloor
tuckbloor / index.html
Created October 26, 2016 20:06
Google maps Get Directions
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps With Postcode To Postcode Directions</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/standard.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
@tuckbloor
tuckbloor / backlink-checker.php
Created October 26, 2016 20:00
check if a website is linking back to you
@tuckbloor
tuckbloor / index.html
Created October 26, 2016 19:53
knockout js filter using checkboxes instead of radio like the demo uses
<!DOCTYPE html>
<html>
<head>
<script src="js/ko.js" type="text/javascript"></script>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<style type='text/css'>
body { font-family: arial; font-size: 14px; }
.liveExample { padding: 1em; background-color: #EEEEDD; border: 1px solid #CCC; max-width: 655px; }
.liveExample input { font-family: Arial; }
$(function() {
Dropzone.autoDiscover = false;
$("form#dropzone").dropzone({
autoProcessQueue: false,
maxFiles: 1,
init: function () {
var dropzone = this;
$('#uploadSubmit').on('click', function (e) {
e.preventDefault();
e.stopPropagation();
@tuckbloor
tuckbloor / gist:b5e3590f22bdde14af109683f7fe5e3b
Created June 15, 2016 07:36
load data into modal with jquery and laravel
$(document).on("click", ".open-document-modal", function () {
var document_id = $(this).data('document_id');
$.post('/details',{ document_id: document_id}, function(data) {
$('#documentModal').load('/adocument-modal', { data: data });
})
});
@tuckbloor
tuckbloor / .htacces
Created April 28, 2016 10:42
htacces cross domain
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type, Authorization"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
@tuckbloor
tuckbloor / app\User.php
Last active April 19, 2016 08:11
laravel 5.2 user model with jenssegers monngo
<?php
namespace App;
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
//use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Auth\Authenticatable as AuthenticableTrait;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
@tuckbloor
tuckbloor / gist:9908ab0f556381bfee2f
Last active March 2, 2016 09:25
angular datepicker instance for multiple datepickers
html
<p class="input-group">
<input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="latestRevision(dValue).date_returned" close-text="Close" datepicker-options="datePicker.options" is-open="datePicker.instances['returned'+dValue.document_id]" />
<span class="input-group-btn">
<button type="button" class="btn btn-sm btn-default no-border" datepicker-options="datePicker.options" close-text="Close" ng-click="datePicker.open($event, 'returned'+dValue.document_id)"><i class="fa fa-calendar"></i></button>
</span>
</p>
js
$scope.datePicker = (function() {