Skip to content

Instantly share code, notes, and snippets.

View 65's full-sized avatar

Duncan Isaksen-Loxton 65

View GitHub Profile
@65
65 / complete.js
Last active August 29, 2015 14:02
Gmail Script - email to pdf to xero
function send_Gmail_as_PDF() {
var gLabel = "#Receipt";
var thread = GmailApp.search("label:" + gLabel);
for (var x = 0; x < thread.length; x++) {//for all emails
var messages = thread[x].getMessages();
for (var y = 0; y < 1; y++) {// only do on the first email, use messages.length otherwise
var attach = messages[y].getAttachments();
@65
65 / Buildings GeoJSON
Last active August 29, 2015 14:21
Medic52 GeoJSON Examples
"buildings":{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[148.391956873,-36.41520944409831,0],
@65
65 / GeoJSON Style definitions
Last active August 29, 2015 14:21
GeoJSON Style definitions
"style_buildings":{
"color": "#0000ff",
"weight":"1"
},
"style_green":{
"color": "#00ff00",
"weight":"3"
},
"style_red":{
"color": "#ff0000",
{
"style_buildings":{
"color": "#0000ff",
"weight":"1"
},
"style_green":{
"color": "#00ff00",
"weight":"3"
},
"style_red":{
@65
65 / pinterest.js
Created February 26, 2012 01:28
pinterest buttons on every image in a blog post using jquery
$().ready(function() {
$('.entry-body img').each(function(){
var $permalink = $(this).parents('.entry').find('.permalink').attr('href');
$(this).wrap('<div class="pinme" style="' + $(this).attr('style') + '" />').after('<a href="http://pinterest.com/pin/create/button/?url=' + $permalink + '&media=' + $(this).attr('src') + '&description=' + $(this).attr('alt') + '" class="pin-it-button" count-layout="vertical">Pin It</a>');
});
$('.pinme').hover(function() {
$(this).children('iframe').css('display','block');
}, function() {
$(this).children('iframe').css('display','none');
@65
65 / comments.html
Created February 27, 2012 06:20
Typepad connect comments in advanced template
<MTEntryIfAllowComments>
<a id="comments"></a>
<h3 class="comments-header"><$MTTrans phrase="Comments"$></h3>
<div class="comments-content">
<div id="tpc_thread"></div>
<div style="display:none;" id="tpc_post_title"><$MTEntryTitle$></div>
<div style="display:none;" id="tpc_post_message"><$MTEntryBody$></div>
<script type="text/javascript">
var TPConnect = {};
@65
65 / bad.cfm
Created March 5, 2012 05:23
cf loop
<cfloop from="1" to="#upperLimit#" index="myIndex">
@65
65 / antsvnupdate.xml
Created March 5, 2012 09:48
svn update via ANT
<!-- Properties to be set by SVN $ID$ $REV$ -->
<project name="SVN Update" default="update" basedir=".">
<description> Updates to head revision </description>
<!-- all properties are in build.properties -->
<property file="build.properties" />
<!-- path to the svnant libraries. Usually they will be located in ANT_HOME/lib -->
<path id="svnant.classpath">
<fileset dir="${ant.home}">
<include name="**/*.jar"/>
</fileset>
@65
65 / dsn.cfm
Created March 5, 2012 08:55
create coldfusion DSN via admin API
stDSN.driver = "MSSQLServer";
stDSN.name= "DBDSN";
stDSN.host = "192.168.101.109";
stDSN.port = "1433";
stDSN.selectmethod = "direct";
stDSN.database = "DBDSN";
stDSN.username = "DBUsername";
stDSN.password = "DBPassword";
// now create
dsObj.setMSSQL(argumentCollection=stDSN);
sp_fulltext_catalog 'SearchIndexName', 'drop'
go
sp_fulltext_service 'clean_up'
go