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 / codekit_coda2_hook
Last active February 21, 2017 16:08
Codekit Hook: Trigger Coda 2 Publication
delay 0.05
tell application "Coda 2" to activate
tell application "System Events"
keystroke "p" using {command down, control down}
end tell
@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 / functions.php
Created November 14, 2016 10:01
Wordpress upload kmz / kml files
function add_upload_mimes($mimes=array()) {
$mimes['kml']='application/vnd.google-earth.kml+xml';
$mimes['kmz']='application/vnd.google-earth.kmz';
return $mimes;
}
add_filter("upload_mimes","add_upload_mimes");
@pierrehenri220
pierrehenri220 / Dot underscore
Created November 14, 2016 10:02
Remove dot underscore files in mac / linux inside the current directory
find . -name "._*" -exec rm -f {} \;
@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>