Skip to content

Instantly share code, notes, and snippets.

View pierrehenri220's full-sized avatar

Peter (ピエール) pierrehenri220

View GitHub Profile
@pierrehenri220
pierrehenri220 / sort_css.pl
Created July 1, 2016 00:29
Perl script to sort css properties
#!/usr/bin/perl
# Author: Kyo Nagashima <kyo@hail2u.net>, http://hail2u.net/
# xaicron, http://blog.livedoor.jp/xaicron/
# License: MIT license (http://opensource.org/licenses/mit-license.php)
# Modified: 2009-11-17T23:09:27+09:00
use strict;
use warnings;
@pierrehenri220
pierrehenri220 / mt_db
Created November 14, 2016 08:57
The following shell command invites you to the mysql prompt ( Default password is root ) /Applications/MAMP/Library/bin/mysql -u root -p The following mysql command creates an empty mt database CREATE DATABASE mt DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
The following shell command invites you to the mysql prompt ( Default password is root )
/Applications/MAMP/Library/bin/mysql -u root -p
The following mysql command creates an empty mt database
CREATE DATABASE mt DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
@pierrehenri220
pierrehenri220 / MAMP Perl path
Created November 14, 2016 08:57
Fix Movable Type perl path with MAMP
cd /Applications/MAMP/cgi-bin/mt/
find . -name "*.cgi" -exec perl -pi -e "s,\#\!\/usr\/bin\/perl -w,\#\!\/Applications\/MAMP\/Library\/bin\/perl -w," {} \;
@pierrehenri220
pierrehenri220 / html5 video
Created November 14, 2016 09:59
HTML5 Video Object with iPhone6s on Apple Website
<video class="asvideo-ended" crossorigin="anonymous" itemscope="itemscope" itemtype="http://schema.org/VideoObject" preload="none" width="540" height="540" poster="http://store.storeimages.cdn-apple.com/8311/as-images.apple.com/is/image/AppleInc/aos/published/images/i/ph/iphone6s/web/iphone6s-web-360?wid=540&amp;hei=540&amp;fmt=png-alpha&amp;qlt=95&amp;.v=1441814332773">
<source itemprop="contentUrl" src="http://store.storevideos.cdn-apple.com/v1/store.apple.com/media/video/iphone6s-web-360/iphone6s-web-360.mp4" type="video/mp4">
<source itemprop="contentUrl" src="http://store.storevideos.cdn-apple.com/v1/store.apple.com/media/video/iphone6s-web-360/iphone6s-web-360.WebM" type="video/webm">
<object width="540" height="540" data="http://store.storevideos.cdn-apple.com/v1/store.apple.com/media/video/iphone6s-web-360/iphone6s-web-360.mov" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=7,3,0,0">
<param name="src" value="http:/
@pierrehenri220
pierrehenri220 / gist:6843a969f63131c75c3127ab5ea0701f
Created November 14, 2016 10:00 — forked from wokamoto/gist:5771b3b0b9b83d2e1642
[PHP] Google Calendar API v3 から祝日取得
<?php
function get_holidays_this_month($year, $month){
// 月初日
$first_day = mktime(0, 0, 0, intval($month), 1, intval($year));
// 月末日
$last_day = strtotime('-1 day', mktime(0, 0, 0, intval($month) + 1, 1, intval($year)));
$api_key = 'YOUR API KEY HERE';
$holidays_id = 'outid3el0qkcrsuf89fltf7a4qbacgt9@import.calendar.google.com'; // mozilla.org版
@pierrehenri220
pierrehenri220 / mtt.sh
Created November 14, 2016 10:02
Microsoft TrueType core fonts installation helper for Fedora Linux
#!/bin/bash
################################################################################
# Microsoft TrueType core fonts installation helper for Fedora Linux
#
# This script is installing the fonts without any untrustworthy 3rd-party RPMs
# or build-hazzle. I think it is useful because the MS core web fonts are not
# included in the main repositories (licensing issues). And (IMHO), it is a bit
# extreme to build a package on your own just to install a few fonts. This
# script is inspired by
@pierrehenri220
pierrehenri220 / doctype.xsl
Created November 14, 2016 10:04
Doctype Output in XSLT
<xsl:template name="foo_bar">
<xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;</xsl:text>
</xsl:template>
@pierrehenri220
pierrehenri220 / prefectures_jp.kml
Created November 14, 2016 10:18
Foursquare KML history file with japanese prefectures. For testing purposes. Dummy Foursquare check-in feed ( kml version ) with primary cities from the japanese prefectures as coordinates. The web source is included in the description field. The author grabbed data manually from Google Map, it's not the offical exact geolocation.
<?xml version="1.0" encoding="UTF-8"?>
<kml>
<Folder>
<name>都道府県庁所在地 緯度経度データ</name>
<description>ソース:http://www.benricho.org/chimei/latlng_data.html</description>
<Placemark>
<name>1北海道</name>
<description>札幌市</description>
<updated>Thu, 09 Feb 12 04:18:49 +0000</updated>
<published>Thu, 09 Feb 12 04:18:49</published>
@pierrehenri220
pierrehenri220 / dump_selector
Created November 28, 2016 10:13
Merge scss and keep only the selectors
#!/bin/bash --ev
find . -name '*.scss' -exec cat {} > override.scss \;
perl -pi -e "s,.*?:.*\s\S,,g" override.scss
perl -pi -e "s,.*\@.*\n,,g" override.scss
@pierrehenri220
pierrehenri220 / keybase.md
Created December 21, 2016 00:40
keybase.md

Keybase proof

I hereby claim:

  • I am grenouille220 on github.
  • I am grenouille220 (https://keybase.io/grenouille220) on keybase.
  • I have a public key ASDaCEUR3q1AuN29ObdGHEHgb7h8gLqF2CTKULJIsvIJDwo

To claim this, I am signing this object: