Skip to content

Instantly share code, notes, and snippets.

🐮
Moooooooooo!

J.P. Given iamjpg

🐮
Moooooooooo!
Block or report user

Report or block iamjpg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@iamjpg
iamjpg / toast.js
Created May 30, 2019
Vitruvius Toast Signature
View toast.js
import Toast from 'path_to_toast_js';
let toast = new Toast();
toast.show({
type: 'success',
header: 'This is a Header',
message: 'This toast was created with the "removeIn" option meaning this toast will dissapear in 5 seconds.',
removeIn: 5000,
});
@iamjpg
iamjpg / PhysicalLatLonToPixelXY.html
Last active Sep 19, 2018
Google Maps v3 – Translate Physical Latitude/Longitude into Screen Pixel X/Y
View PhysicalLatLonToPixelXY.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>google_maps_custom_point</title>
<style>
body {
margin: 0;
@iamjpg
iamjpg / jquery.ba-tinypubsub.js
Created Aug 22, 2012 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
View jquery.ba-tinypubsub.js
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@iamjpg
iamjpg / gist:3194394
Created Jul 28, 2012
The Iron by Henry Rollins
View gist:3194394
This article originally appeared in Details Magazine some time around 1994 or 1995, I believe. This is a great essay by Henry Rollins on the benefits and lessons of lifting weights.
=================================================
I believe that the definition of definition is reinvention. To not be like your parents. To not be like your friends. To be yourself.
Completely.
When I was young I had no sense of myself. All I was, was a product of all the fear and humiliation I suffered. Fear of my parents. The humiliation of teachers calling me "garbage can" and telling me I'd be mowing lawns for a living. And the very real terror of my fellow students. I was threatened and beaten up for the color of my skin and my size. I was skinny and clumsy, and when others would tease me I didn't run home crying, wondering why.
@iamjpg
iamjpg / gist:3044289
Created Jul 4, 2012
Reactive Image jQuery Plugin
View gist:3044289
// Written by: J.P. Given
// http://johnpatrickgiven.com
// jgiven { at } gmail { com }
(function ( $, window ) {
var pluginName = 'reactiveImage',
pl = null,
document = window.document,
defaults = {
@iamjpg
iamjpg / server.js
Created Nov 21, 2011 — forked from jeffrafter/server.js
Twitter OAuth with node-oauth for node.js+express
View server.js
var express = require('express');
var sys = require('sys');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY";
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET";
function consumer() {
@iamjpg
iamjpg / gist:1304547
Created Oct 21, 2011
search.html.haml
View gist:1304547
%script{:type => "text/javascript"}
:plain
$(document).ready(function(){
$('body').attr('data-sitebase', "#{request.url}");
$('body').attr('data-servicebase',"#{@service_base_url}");
$('body').attr('data-serviceversion',"#{@service_version}");
$('body').attr('data-usertoken',"#{@user_id}");
$('body').attr('data-agenttoken', "6f62a0d9-479d-4e16-a473-90e671c65979");
var search_height = $(window).height() - $('#shared-footer').outerHeight(true) - $('#shared-header').outerHeight(true);
var search_width = $(window).width();
@iamjpg
iamjpg / gist:1302277
Created Oct 20, 2011
Javascript Riddle
View gist:1302277
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>JS Riddle</title>
</head>
<body>
<h3>Print 0 to 100 to the browser without using a global variable in JS</h3>
<div id="print"></div>
View Android Layout With Buttons Pinned on Bottom
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_weight="1"
You can’t perform that action at this time.