Skip to content

Instantly share code, notes, and snippets.

View jeremejazz's full-sized avatar

Jereme Causing jeremejazz

View GitHub Profile
@jessearmand
jessearmand / osm_maps_downloader.py
Created November 6, 2012 14:26
Download map tiles from MapQuest open street map source
#!/usr/local/bin/python
from sys import argv
import os
import math
import urllib2
def deg2num(lat_deg, lon_deg, zoom):
lat_rad = math.radians(lat_deg)
n = 2.0 ** zoom
@jeremejazz
jeremejazz / ConvertHoursMins.php
Created June 3, 2013 05:31
used to convert Hours:Mins to minutes and the other way around
<?php
function convertMinsToHours($time, $format = '%d:%s') {
settype($time, 'integer');
if ($time < 0 || $time >= 1440) {
return;
}
$hours = floor($time/60);
$minutes = $time%60;
if ($minutes < 10) {
@randyjensen
randyjensen / social_network_metadata
Created August 30, 2013 01:20
Meta Data For Social Networks
Facebook Open Graph
<head>
<meta property="og:title" content="Title Goes Here">
<meta property="og:description" content="description-goes-here">
<meta property="og:type" content="your-content-type-goes-here"> (e.g., "article")
<meta property="og:url" content="http://www.your-site.com/">
<meta property="og:image" content="http://www.your-site.com/image.jpg">
<meta property="og:site_name" content="your-site-name">
<meta property="fb:admins" content="your-Facebook-page-user-ID">
@matthewhudson
matthewhudson / gist:1603502
Created January 12, 2012 22:21
Integrate Open Graph with Tumblr
<!-- Open Graph tags for your home page (index). -->
<meta property="og:site_name" content="{Title}" />
<meta property="fb:app_id" content="FACEBOOK_APPID"/>
<meta property="fb:admins" content="FACEBOOK_USERID" />
<meta property="og:description" content="{MetaDescription}" />
<meta property="og:locale" content="en_US" />
{block:IndexPage}
<meta property="og:image" content="{PortraitURL-128}" />
<meta property="og:title" content="{Title}" />
@sixman9
sixman9 / installKivySrc.sh
Last active June 25, 2019 08:38
Installs the latest Kivy source distribution from Github for Debian/Ubuntu
#!/bin/bash
kivyBaseBuildDir=/tmp
myKivyInstallAlias="kivyDev"
#Build and install Kivy on Ubuntu - http://kivy.org/docs/installation/installation.html#development-version
#Modify the PYTHONPATH to point at our Kivy install - see http://docs.python.org/2/tutorial/modules.html#the-module-search-path AND http://docs.python.org/2/tutorial/modules.html#standard-modules
sudo apt-get install python-setuptools python-pygame python-opengl python-gst0.10 python-enchant gstreamer0.10-plugins-good python-dev build-essential libgl1-mesa-dev libgles2-mesa-dev python-pip
if [ ! `pip freeze | grep -i cython` ]; then
@hellpanderrr
hellpanderrr / Python read Excel XML Table.md
Last active March 24, 2021 04:03
Read Excel XML table in a python list
from bs4 import BeautifulSoup
 
def read_excel_xml(path):
    file = open(path).read()
    soup = BeautifulSoup(file,'xml')
    workbook = []
    for sheet in soup.findAll('Worksheet'): 
        sheet_as_list = []
 for row in sheet.findAll('Row'):
@manfromanotherland
manfromanotherland / formspree.html
Last active July 30, 2021 07:05
JS: Ajax send forms using the most excellent Formspree » http://formspree.io #snippet
<form id="contact-form" action="//formspree.io/your@email.com" method="post">
<input type="text" name="Name" placeholder="Name" required>
<input type="email" name="Email" placeholder="Email" required>
<textarea name="Message" cols="30" rows="6" placeholder="Message" required></textarea>
<!-- CONFIG -->
<input class="is-hidden" type="text" name="_gotcha">
<input type="hidden" name="_subject" value="Subject">
<input type="hidden" name="_cc" value="email@cc.com">
<!-- /CONFIG -->
<input class="submit" type="submit" value="Send">
javascript: (function () {
function c() {
var e = document.createElement("link");
e.setAttribute("type", "text/css");
e.setAttribute("rel", "stylesheet");
e.setAttribute("href", f);
e.setAttribute("class", l);
document.body.appendChild(e)
}
function h() {
@soomtong
soomtong / summernote.php
Last active March 2, 2022 12:14
(deprecated) summernote example with php
<!-- this version of sample is too old. it's not follow recent version of summernote api -->
<!-- should check new apis and examples! sorry I am. -->
<!DOCTYPE html>
<html lang="en">
<!-- include libries(jQuery, bootstrap, fontawesome) -->
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.no-icons.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
@ksafranski
ksafranski / SimpleStore.js
Last active July 2, 2022 15:25
Simple localStorage function with Cookie fallback for older browsers.
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve: