Skip to content

Instantly share code, notes, and snippets.

View suisho's full-sized avatar
🚫
Deprecated

Old account suisho

🚫
Deprecated
View GitHub Profile
@suisho
suisho / timecop.md
Created February 27, 2014 13:07
timecopでstrptimeがおかしい

Timecopでstrptimeを使った時の挙動の話

Timecopをgemで取り込んでからどうもstrptimeの挙動がおかしい。 現象としては古い年月だとずれた時間が返されてしまうのだ

通常時

Date.strptime("1500-10-10").strftime("%Y-%m-%d")
=> "1500-10-10"
require 'formula'
class Solr < Formula
homepage 'http://lucene.apache.org/solr/'
url 'http://www.apache.org/dyn/closer.cgi/lucene/solr/4.7.0/solr-4.7.0.tgz'
sha1 '5599a33f6d7c46251d87ff226709e759572ade4b'
def script; <<-EOS.undent
#!/bin/sh
if [ -z "$1" ]; then
Tail = require('tail').Tail;
var path = require("path")
var filename = path.resolve(process.argv[2]);
tail = new Tail(filename);
tail.on("line", function(data) {
try{
var parsed = JSON.parse(data)
console.log(JSON.stringify(parsed, null, " "))
}catch(e){
@suisho
suisho / Gruntfile.coffee
Created May 1, 2014 15:28
rails compass gruntfile
module.exports = (grunt) ->
require('load-grunt-tasks')(grunt)
grunt.initConfig
compass :
dist:
options:
debugInfo : true
bundleExec: true
app: "rails"
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@suisho
suisho / checklist.md
Last active August 29, 2015 14:04
ruby-installが失敗することにやることメモ
@suisho
suisho / HeaderPagingLayout.swift
Created October 9, 2014 13:40
HeaderPagingLayout
class HeaderPagingLayout : UICollectionViewFlowLayout{
let velocityThreshold : CGFloat = 0.1
func proposedAttributes() -> [UICollectionViewLayoutAttributes]{
if let proposedRect = self.collectionView?.bounds{
return self.layoutAttributesForElementsInRect(proposedRect) as? [UICollectionViewLayoutAttributes] ?? []
}
return []
}
@suisho
suisho / SassMeister-input.scss
Created January 30, 2015 14:27
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
$color-palette :(
red : (
base : #ff0000,
dark : #ffcccc
),
@suisho
suisho / SassMeister-input.scss
Created January 30, 2015 14:41
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
// http://erskinedesign.com/blog/friendlier-colour-names-sass-maps/
//http://maketea.co.uk/2014/07/21/managing-relationships-between-colours-with-sass.html
// setting
$color-palette :(
red : (
@suisho
suisho / babel.js
Last active August 29, 2015 14:17
Babelで理解するEcmaScript6の import / export ref: http://qiita.com/suisho/items/41168a50904242005271
"use strict";
function foo() {}
module.exports = { foo: foo };