Skip to content

Instantly share code, notes, and snippets.

@zaki50
zaki50 / FloatingActionButton.java
Last active August 29, 2015 14:03
Material Design の FloatingActionButton のためのクラスを作ってみた
/*
* Copyright (C) 2014 uPhyca Inc.
*
* 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
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active September 4, 2024 05:58
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* 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
@akjava
akjava / metaconvert.js
Created May 27, 2013 05:03
Conver meta text to document for Google Apps Script works in Document container. metas line equals #page , do page break line ends with #14b ,line convert to font-size 14 and bold text
/**
Conver meta text to document
metas
line equals #page , do page break
line ends with #14b ,line convert to font-size 14 and bold text
todo
#{font-size}{i|b|p|ib};
@jrhames
jrhames / moment-holidays.js
Last active January 19, 2023 03:12
Holidays plugin for Moment.JS
//## Moment.JS Holiday Plugin
//
//Usage:
// Call .holiday() from any moment object. If date is a US Federal Holiday, name of the holiday will be returned.
// Otherwise, return nothing.
//
// Example:
// `moment('12/25/2013').holiday()` will return "Christmas Day"
//
//Holidays:
@iki
iki / README.md
Last active December 14, 2015 18:49
Building Angular.js on Windows

Building Angular.js on Windows

Current grunt based build

  1. Install grunt launcher.

     npm install -g grunt-cli
    
  2. Run grunt as Administrator. That's needed to create directory symlinks using mklink /d.

@vvakame
vvakame / Gruntfile.js
Created February 28, 2013 02:32
Slim3 + TypeScript なプロジェクトのGruntfile.jsとか run_server.sh も grunt start-server とかにするべきかなと思う
module.exports = function (grunt) {
grunt.initConfig({
typescript: {
client: { // --declarations --sourcemap --target ES5 --out client/scripts/main.js client/scripts/main.ts
src: ['src/main/typescript/Ignite.ts'],
dest: 'src/main/webapp/scripts/main.js',
options: {
target: 'es5',
base_path: 'src/main/typescript',
sourcemap: false,
@vvakame
vvakame / to-java7.diff
Created February 20, 2013 03:43
Slim3プロジェクトをJava7で開発できるようにした。@zaki50 さんありがとう。 仕事のプロジェクトなので、全体貼るのがめんどくさいのでdiffだけぺとんちょ。
Date: Wed, 20 Feb 2013 12:40:23 +0900
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
appengine/pom.xml | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/appengine/pom.xml b/appengine/pom.xml
@vvakame
vvakame / ChannelController.java
Last active December 11, 2015 10:09
GAE/J のChannel APIを試した時のサンプル。 一意のIDからTokenを生成して利用する。送信する時は一意のIDに対して送信を行うのでTokenなどを知っている必要はない。 まとめると、User KindのKeyのIDなりNameなりに対して適当にメッセージを送りつけてやれば相手が受信可能であれば受け取る。といった感じみたい。たぶん。
import java.io.PrintWriter;
import java.io.Writer;
import java.util.List;
import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import org.slim3.datastore.Datastore;
import org.slim3.repackaged.org.json.JSONObject;
import org.slim3.util.StringUtil;
@rcknr
rcknr / DriveUpload.gs
Last active February 15, 2023 20:06
This is a sample code to upload a PDF file to Google Drive with OCR in Apps Script. uploadPdfOcr function returns a File object. To run the code provide a developer key for an API Console project with Drive API service enabled.
function uploadPdfOcr() {
authorize();
var key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // <-- developer key
var file = UrlFetchApp.fetch("http://somewhere.com/path/file.pdf").getBlob();
var metadata = { title: file.getName() }
var params = {method:"post",
oAuthServiceName: "drive",
oAuthUseToken: "always",
contentType: "application/pdf",
contentLength: file.getBytes().length,
@akbertram
akbertram / d3.caja.js
Created November 26, 2012 01:29
Caja-safe d3.js
d3 = {
version: "2.10.3"
};
(function() {
function d3_class(ctor, properties) {
try {
for (var key in properties) {
Object.defineProperty(ctor.prototype, key, {
value: properties[key],