Skip to content

Instantly share code, notes, and snippets.

View squallstar's full-sized avatar
🍉

Nicholas Valbusa squallstar

🍉
View GitHub Profile
[
{
"no": 1,
"kanji": "一",
"keyword": "one"
},
{
"no": 2,
"kanji": "二",
"keyword": "two"
@squallstar
squallstar / Gruntfile.js
Last active January 10, 2016 11:10
Retina images with Grunt
//Grunt Spritesmith plugin
sprite: {
build: {
src: ['src/img/sprite/*.png'],
destImg: 'build/img/s-' + timestamp + '.png',
destCSS: 'src/scss/common/sprite.scss',
imgPath: '../img/s-' + timestamp + '.png',
algorithm: 'binary-tree',
engine: 'gm',
'engineOpts': {
@squallstar
squallstar / meta.html
Last active December 31, 2015 18:29
Live tiles on Windows 8
<meta name="application-name" content="Your app name" />
<meta name="msapplication-TileColor" content="#000000"/>
<meta name="msapplication-square70x70logo" content="http://logo.png" />
<meta name="msapplication-square150x150logo" content="http://logo2.png" />
<meta name="msapplication-wide310x150logo" content="http://logo3.png" />
<meta name="msapplication-square310x310logo" content="http://logo4.png" />
<meta name="msapplication-notification" content="frequency=30; polling-uri=http://example.org/livetile/1.xml; polling-uri2=http://example.org/livetile/2.xml; polling-uri3=http://example.org/livetile/3.xml; polling-uri4=http://example.org/livetile/4.xml" />
@squallstar
squallstar / imgregexp.php
Created October 11, 2013 13:48
PHP Regexp to extract images
<?php
//Full image URLs will be extracted into $matches[2]
preg_match_all("/<(img)?+[^>]* src=['\"]([^\"']+\.(jpe?g|png)[#?]?[^\"']*?)[\"']/i", $html, $matches);
@squallstar
squallstar / define.coffee
Created September 24, 2013 09:14
AMD/CommonJS/Module.exports
if typeof define is 'function' and define.amd
# AMD
define -> MyObject
else if typeof exports is 'object'
# CommonJS
module.exports = MyObject
else
# Global
MyObject.init()
@squallstar
squallstar / date.prototype.js
Last active December 23, 2015 08:59
Date UTC timestamp
Date.prototype.getUTCTimestamp = function() {
var currentTime, localOffset;
currentTime = this.getTime();
localOffset = (-1) * this.getTimezoneOffset() * 60000;
return Math.round(new Date(currentTime + localOffset).getTime() / 1000);
};
@squallstar
squallstar / ellipsis.css
Last active December 21, 2015 22:59
css ellipsis
foo {
width:200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
@squallstar
squallstar / うちに来ます
Last active December 2, 2015 09:36
日本語
スミス:おはようございます。
ニコラス:おはようございます。
スミス:どうぞおはいりください。
ニコラス:しつれいします。
スミス:どうぞこちらえ。
スミス:車できましたか。
ニコラス:いいえ、着てんしゃで行きました。
スミス:ああ、そうですか。
スミス:どうぞおかけください。
ニコラス:どうもありがとう。
@squallstar
squallstar / example.js
Last active November 27, 2015 15:54
bb collection
var Beacon = Backbone.Model.extend({
defaults: {
name: String
}
});
var Beacons = Backbone.Collection.extends({
model: Beacon,
url: '/beacons'
});
@squallstar
squallstar / Readme.md
Created April 26, 2012 07:54
Multiple subdomains on a single Bancha installation

Bancha multidomain plugin

How to install:

(soon)