Skip to content

Instantly share code, notes, and snippets.

View parkerproject's full-sized avatar

Parker parkerproject

View GitHub Profile
<!doctype html>
<html>
<head>
<!-- Run in full-screen mode. -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Make the status bar black with white text. -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">
@parkerproject
parkerproject / gist:10602300
Created April 13, 2014 21:05 — forked from pcg79/gist:738207
Manipulate Interstitial
<script type="text/javascript">
$(document).ready(function() {
var href = $("#redirect_url")[0].href;
$("a#replace_me").attr("href", href);
$("a#replace_me").text(href);
$("#redirect_to").hide();
});
</script>
<p>Greetings. We are now redirecting you to the site that you requested.</p>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
/* Below is the structure of the JSON data that will be stored in MongoDB */
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
Input: <input type="text" ng-model="hello"><br>
// http://localhost:4000/api/postcodesNear?postcode=4101&range=2
action('postcodesNear', function () {
var earthRadius = 6378;
var qPostcode = req.query.postcode || 4101;
var qRange = Number(req.query.range) || 2;
Postcode .findOne({ 'postcode': qPostcode })
.run(function(err, postcode) {
if (err) send(err);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var _fragment = document.createDocumentFragment();
@parkerproject
parkerproject / gist:b6b47eb6c91d37c6c8fc
Created July 2, 2015 18:18
doing something with URL
uiData = uiData.replace('?','');
var uiDataArray = uiData.split('&');
var eObj = {};
uiDataArray.map(function(data){
var eArray = data.split('=');
eObj[eArray[0]] = eArray[1];
console.log(eObj);
return eObj
});
var emails = querySelectorAll('.email);
var emailsArr = [].slice.call(emails);
var d = []; emailsArr.forEach(function(email){ d.push(email.textContent)});
<!doctype html>
<html ng-app="myApp">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
<script type="text/javascript">
var myApp = angular.module('myApp', [], function ($interpolateProvider) {
$interpolateProvider.startSymbol('[[');
$interpolateProvider.endSymbol(']]');
});
@parkerproject
parkerproject / getpramfromurl.js
Last active August 29, 2015 14:25 — forked from TastyToast/getpramfromurl.js
Get a pram from url
function getParameterByName(name) {
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
// Useful for a url like www.iframe.com/93493434?pram_name=2323