Skip to content

Instantly share code, notes, and snippets.

@mhawksey
mhawksey / code.js
Created September 17, 2012 12:29
Google Apps Script to generate ChartFusion datasource xml from a Google Spreadsheet
//http://www.google.sc/support/forum/p/apps-script/thread?tid=345591f349a25cb4&hl=en
function setUp() {
ScriptProperties.setProperty('active', SpreadsheetApp.getActiveSpreadsheet().getId());
var svc = ScriptApp.getService();
if (!svc.isEnabled()) {
// it's not enabled, and should be
svc.enable(svc.Restriction.ALL);
}
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head> <meta charset="utf-8"> </head>
<body>
<div> <button id="show-docs-picker">Select Documents in Google Docs</button> </div>
<div> <ul id="picked"></ul> </div>
<script src="https://www.google.com/jsapi"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script type="text/javascript">
(function () {
@tbroyer
tbroyer / ActivityAsyncProxy.java
Created July 3, 2012 10:07
ActivityAsyncProxy
/*
* Copyright 2012 Thomas Broyer <t.broyer@ltgt.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mhawksey
mhawksey / gist:3007293
Created June 27, 2012 22:26
Turn Google Site pages into RSS feed
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
(function(global) {
var Hoge, Fuga, SampleView;
Hoge = (function() {
function Hoge() {
}
Hoge.prototype.init = function(str) {
str = str || "hoge";
@vvakame
vvakame / BitmapType.java
Created June 14, 2012 23:27
ORMLiteでBitmapなフィールドを良い感じに処理してくれるPersisterClass
package net.vvakame.android.entity;
import java.io.ByteArrayOutputStream;
import java.sql.SQLException;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Bitmap.CompressFormat;
import com.j256.ormlite.field.FieldType;
@mhawksey
mhawksey / gist:2720726
Created May 17, 2012 18:20
Google Apps Script fetch feed item link
function fetchUrlfromRSS(url) {
var cache = CacheService.getPublicCache(); // using Cache service to prevent too many urlfetch
var cached = cache.get(url);
if (cached != null) { // if value in cache return it
return cached;
}
// otherwise build urlfetch
var options = {"method" : "get"};
try {
var response = UrlFetchApp.fetch(url , options);
@YusukeKokubo
YusukeKokubo / Hello.gwt.xml
Created April 27, 2012 05:25
Hello GwtQuery
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd">
<module rename-to="hello">
<inherits name="com.google.gwt.user.User" />
<inherits name='com.google.gwt.query.Query' />
<source path="client" />
<entry-point class="as.client.Hello"></entry-point>
</module>
@cynipe
cynipe / git-flow-with-maven-release-plugin.rst
Created March 22, 2012 07:49
git-flow + maven-release-plugin用の手順

git-flow + maven-release-plugin用の手順

前提

プロジェクトのルートPOMに以下の設定が書かれている必要がある。

SCM情報の設定

@kimukou
kimukou / GDataOAuth2.groovy
Created February 25, 2012 09:04
GDataOAuth2.groovy
//
// ref https://gist.github.com/1899391
import java.io.*
import java.net.*
import groovy.transform.Field
//see @Field's Explanation http://d.hatena.ne.jp/uehaj/20110703/1309685397