Skip to content

Instantly share code, notes, and snippets.

View jeremejazz's full-sized avatar

Jereme Causing jeremejazz

View GitHub Profile
@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}" />
@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
@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
@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:
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() {
@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">
@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">
@Cheesebaron
Cheesebaron / Chemical.cs
Last active March 15, 2023 19:30
Custom Adapter with Filter
namespace SearchViewSample
{
public class Chemical
{
public string Name { get; set; }
public int DrawableId { get; set; }
}
}
@Cheesebaron
Cheesebaron / JavaHolder.cs
Last active March 15, 2023 19:30
C# to Java object wrapper
using System;
public class JavaHolder : Java.Lang.Object
{
public readonly object Instance;
public JavaHolder(object instance)
{
Instance = instance;
}