Skip to content

Instantly share code, notes, and snippets.

@lilac
lilac / ckedit.py
Last active August 29, 2015 14:11 — forked from dengshuan/ckedit.py
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import admin
from wtforms import TextAreaField
from wtforms.widgets import TextArea
from flask.ext.admin.contrib.sqla import ModelView
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'
public class Singleton {
private Singleton() {
// Constructor code goes here.
}
private static class LazyHolder {
private static final Singleton INSTANCE = new Singleton();
}
public static Singleton getInstance() {
@lilac
lilac / defer evaluation
Created March 10, 2015 00:27
Implement heterogeneous collection by lazy types.
type 'a lazy = unit -> 'a
val defer : 'a -> ('a -> 'b) -> 'b lazy
fun defer a f = fn () => f a

CSS3 Flat Circle/Round Icon Animation

Use any image with this. The image does not have to be round and can be any size but it should have an aspect ratio of 1:1.

Just a variation of my other pen: Water Drop Circle Effect as CSS3 Animation

A Pen by Jascha Goltermann on CodePen.

License.

@lilac
lilac / index.html
Last active August 29, 2015 14:21 — forked from anonymous/index.html
Ember render with promise
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script>
<script src="http://builds.emberjs.com/tags/v1.8.0/ember.js"></script>
<style id="jsbin-css">
@lilac
lilac / post-receive
Created May 23, 2015 10:17
Git deploy
#!/bin/bash
function pychanged {
git diff --name-only $1 $2 |grep -q ".py$"
}
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "production" == "$branch" -o "master" == "$branch" ]; then
@lilac
lilac / promise.html
Created May 24, 2015 23:45
Ember PromiseProxyMixin
<!DOCTYPE html>
<!--
Created using JS Bin
http://jsbin.com
Copyright (c) 2015 by anonymous (http://jsbin.com/hizoperevo/1/edit)
Released under the MIT license: http://jsbin.mit-license.org
-->
<meta name="robots" content="noindex">
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="0"
android:startColor="#f00"
android:centerColor="@android:color/transparent"
android:centerX="0.01" />
</shape>
public class OptionLayout extends LinearLayout
{
@InjectView(R.id.title)
TextView title;
@InjectView(R.id.summary)
TextView summary;
@InjectView(R.id.content)
ViewGroup content;