Skip to content

Instantly share code, notes, and snippets.

View japboy's full-sized avatar
🏠
WFH

Yu Inao japboy

🏠
WFH
View GitHub Profile
@japboy
japboy / cheatsheet.atom
Created August 2, 2009 08:49
My Web document cheatsheets
<?xml version="1.0" encoding="utf-8"?>
<feed
xmlns="http://www.w3.org/2005/Atom"
xml:lang="ja-JP">
<author>
<name>Japboy</name>
</author>
<category/>
<contributor/>
@japboy
japboy / api-datetime.py
Created December 10, 2009 10:00
some python study coding snippets
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Python Date & Time
Usage of datetime library (INCOMPLETE)
"""
from datetime import datetime, timedelta
dt = datetime.datetime(2009,1,1,23,59)
@japboy
japboy / slider.html
Created April 3, 2011 07:08
Some good parts for web creating
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="UTF-8">
<style type="text/css">
body section#slider
{
background-color: #eee;
margin: auto;
@japboy
japboy / create_checksum.sh
Created April 18, 2011 02:40
Small scripts to do damn things automatically
#!/bin/bash
SHA1SUMS='SHA1SUMS'
if [ ${#} -ne 1 ]
then
echo "Usage: bash $0 /path"
exit 1
fi
@japboy
japboy / README.markdown
Created August 27, 2011 06:49
CSS Property Sorter Script

CSS Property Sorter Script

Setup for Vim

  1. Create ~/.vim/ftplugin/css.vim if it's not existed yet.
  2. Open ~/.vim/ftplugin/css.vim and add new lines below:
" CSS Property Sorter Script (:SortCSS to run)
command! -range=% SortCSS :,!python /path/to/css_prop_sorter.py
@japboy
japboy / data_uri_converter.py
Created August 27, 2011 09:01
Data URI Converter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import base64
import mimetypes
import gtk
def get_mimetype_string(file_path):
@japboy
japboy / testee.py
Created September 10, 2011 02:47
Basic TDD style unit testing with PyUnit
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Testee module
This script just writes 'Hello, world.' in your language. This is my study case
of unit testing for test-driven development.
"""
import locale
@japboy
japboy / date.js
Created February 1, 2012 03:02
My stupid JavaScript snippets
/**
* Date related snippets
* @author Yu I.
*/
(function() {
var datetime_rfc1123 = new Date(),
datetime_iso8601 = 'YYYY-MM-DDThh:mm:ss+0000',
unix_timestamp_1 = (datetime_rfc1123).getTime() / 1000.0,
unix_timestamp_2 = Date(datetime_rfc1123).parse,
@japboy
japboy / my_httpd.conf
Created March 25, 2012 04:11
CakePHP 動かすための httpd.conf 最小設定的なモノ
##
# Apache 2: オレオレ設定ファイル (PHP 動かす編)
#
# OS X 標準の httpd.conf に以下のような行を追加して読み出す事:
# Include /path/to/this/my_httpd.conf
#
# @author twitter.com/japboy
# @version 2012-03-25
# DocumentRoot
@japboy
japboy / config
Created June 10, 2012 03:58
Failed to install CurlFtpFS with Homebrew
brew --config
HOMEBREW_VERSION: 0.9
HEAD: fd4ddd8bb2e667686bb420f4157d5326d4130eee
HOMEBREW_PREFIX: /Users/Yu/.homebrew
HOMEBREW_CELLAR: /Users/Yu/.homebrew/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.4
Kernel Architecture: x86_64
Xcode: 4.3
GCC-4.0: N/A