Skip to content

Instantly share code, notes, and snippets.

View remino's full-sized avatar

Rem remino

View GitHub Profile
@remino
remino / hinomaru-short.html
Created January 5, 2012 03:57
Flag of Japan 日の丸 HTML5+SVG+CSS
<svg xmlns="http://www.w3.org/2000/svg" background="#eee" width=420 height=280><circle cx="50%" cy="50%" r="24%" fill="#bc002d" /></svg>
@remino
remino / msconvert.js
Created January 5, 2012 05:37
JavaScript: Convert milliseconds to object with days, hours, minutes, and seconds
function convertMS(ms) {
var d, h, m, s;
s = Math.floor(ms / 1000);
m = Math.floor(s / 60);
s = s % 60;
h = Math.floor(m / 60);
m = m % 60;
d = Math.floor(h / 24);
h = h % 24;
return { d: d, h: h, m: m, s: s };
@remino
remino / jquery-objectified-plugin.js
Created January 5, 2012 05:46
Blank jQuery plugin with helper object
(function($) {
function FooBar($scope) {
this.$scope = $scope;
this.init();
};
FooBar.prototype.doNothing = function() { };
FooBar.prototype.init = function() {
@remino
remino / datediff.js
Created January 5, 2012 06:07
JavaScript: DateDiff & DateMeasure: Calculate days, hours, minutes, seconds between two Dates
(function() {
function DateDiff(date1, date2) {
this.days = null;
this.hours = null;
this.minutes = null;
this.seconds = null;
this.date1 = date1;
this.date2 = date2;
@remino
remino / .htaccess
Created January 5, 2012 06:38
Make DreamHost stats and pages accessible
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(source|stats)/? [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]
</IfModule>
@remino
remino / timecounter.js
Created January 5, 2012 23:24
TimeCounter: jQuery plugin object to display count from certain time
(function($) {
function TimeCounter($clock, $start) {
var that = this;
this.$clock = $clock;
this.$start = $start;
this.since = new Date(this.$start.text());
self.setTimeout(function() { that.init(); }, 200);
}
// FIXME Use DateDiff object instead.
@remino
remino / README
Created January 30, 2012 02:55
MySQL dumps in Git repo
This is the old version. The newest can be found as a repo on GitHub:
https://github.com/remino/mysql2git
@remino
remino / README
Created January 30, 2012 08:38
tarbu: Tar Backup
This is the old version. The newest can be found as a repo on GitHub:
https://github.com/remino/tarbu
@remino
remino / jp-wards.yml
Created March 22, 2012 07:55
Prefectures of Japan with the 23 special wards of Tokyo
# Prefectures of Japan, with lowercase alphabet names and Japanese names,
# sorted in ISO order, with the 23 special wards of eastern Tokyo.
hokkaido: "北海道"
aomori: "青森県"
iwate: "岩手県"
miyagi: "宮城県"
akita: "秋田県"
yamagata: "山形県"
fukushima: "福島県"
@remino
remino / sass_converter.rb
Created April 2, 2012 03:19 — forked from wolfeidau/sass_converter.rb
Sass plugin for Jekyll
module Jekyll
require 'sass'
class SassConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /sass/i
end