Skip to content

Instantly share code, notes, and snippets.

@lilac
lilac / invert-matrix.cpp
Created April 22, 2012 14:54
Invert matrix by Boost uBlas
/*
The following code inverts the matrix input using LU-decomposition with backsubstitution of unit vectors. Reference: Numerical Recipies in C, 2nd ed., by Press, Teukolsky, Vetterling & Flannery.
you can solve Ax=b using three lines of ublas code:
permutation_matrix<> piv;
lu_factorize(A, piv);
lu_substitute(A, piv, x);
*/
@lilac
lilac / Sticky Footer.html
Last active October 4, 2015 21:28
Sample HTML page with Twitter's Bootstrap, Ryan Fait's Sticky Footer, and a full-width footer
@lilac
lilac / index.html
Last active December 22, 2015 03:19
File upload with dropzone.js
<!DOCTYPE html>
<html>
<head>
<title>File Uploader</title>
<script src="js/dropzone.js"></script>
<link rel="stylesheet" type="text/css" href="css/dropzone.css">
</head>
<body>
<form action="/upload" class="dropzone dz-clickable" id="demo-upload">
<div class="dz-default dz-message"><span>Drop files here to upload</span></div>
class Auctioneer {
typedef float Currency;
Currency price;
std::vector<Currency> bids;
public:
/** Accept a buyer's bid.
* id int Buyer's id.
* price Currency Buyer's bid price.
*/
@lilac
lilac / bookmark.js
Created December 3, 2013 05:51
Invoke an action via the browser bookmark.
javascript:(function(w,d){var t=d.title,u=d.location.href;w.open('http://milnk.com/link/submit?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t.split(' - ')[0]));}(window,document));
@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.