Skip to content

Instantly share code, notes, and snippets.

View jshaw's full-sized avatar
🤖
👨‍🎨 👨‍💻

Jordan Shaw jshaw

🤖
👨‍🎨 👨‍💻
View GitHub Profile
@jshaw
jshaw / FBShareExample
Last active June 3, 2022 14:18
Basic FB Share link example that allows custom image url and description for dynamic content. This content would be available in the JS somewhere... like the context.
Core.prototype._initializeFbShare = function() {
$('#Fb-share').on('click', _(this._handleFbShare).bind(this));
};
Core.prototype._handleFbShare = function(event) {
event.preventDefault();
var image_url = this.getPaletteImageUrl(this.picker.config.shade_array);
var palette_name = this.$inputPalName.val();
var lang = document.documentElement.lang;
@jshaw
jshaw / angle-between-points.js
Created March 11, 2022 23:21 — forked from conorbuck/angle-between-points.js
JavaScript: Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};
@jshaw
jshaw / index.html
Created February 20, 2015 21:56
Google Streetview Example
<!DOCTYPE html>
<html>
<head>
<title>Custom Street View panorama tiles</title>
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
@jshaw
jshaw / tableSizeChart.html
Created February 4, 2022 03:22
Table Size Chart
<style type="text/css">
.tg {border-collapse:collapse;border-spacing:0;}
.tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
overflow:hidden;padding:10px 5px;word-break:normal;}
.tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
.tg .tg-baqh{text-align:center;vertical-align:top}
</style>
<table class="tg">
<thead>
@jshaw
jshaw / p5js_video_snippet.js
Created December 12, 2021 22:56
snippet for interpreting, manipulating and displaying video
if(label == "Start"){
flippedVideo.loadPixels();
noStroke();
for (let y = 0; y < flippedVideo.height; y += 8) {
for (let x = 0; x < flippedVideo.width; x += 8) {
let offset = ((y*flippedVideo.width)+x)*4;
fill(flippedVideo.pixels[offset],
flippedVideo.pixels[offset+1],
flippedVideo.pixels[offset+2]);
rect(x, y, 8, 8);
@jshaw
jshaw / django-url-in-transblock
Created April 3, 2013 17:33
Django, having a url tag inside of a trans tag or transblock tag....
{%url 'nominations-form' as nomination_form %}
{% blocktrans %}
<p>Be the first to <a href="{{ nomination_form }}">nominate your community.</a></p>
{% endblocktrans %}
@jshaw
jshaw / snippetfile1.json
Last active December 17, 2020 01:43
Example marketing payload Optional fields: * api_key * legal array
{
email: "email@gmail.com"
}
@jshaw
jshaw / snippetfile2.json
Created September 14, 2020 18:26
Example marketing payload, only email
{
email: "email@gmail.com"
}
@jshaw
jshaw / .bash_profile
Created February 13, 2019 14:23 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@jshaw
jshaw / underscore-template-conditional.js
Created July 19, 2012 13:55
Underscore.js template conditional example
// If URL is available URL link the image
// Otherwise just display the image
<% if ( instagram_link_url ) { %> <a href="<%= instagram_link_url %>" target="_blank"> <% } %>
<img src="<%= url %>" alt="<%= username %>" />
<% if ( instagram_link_url ) { %> </a> <% } %>
// Example 2 - Check if formated date
<% if (typeof(date) != "undefined") { %>
<span class="date"><%= date %></span>
<% } %>