Skip to content

Instantly share code, notes, and snippets.

View mrmoneyc's full-sized avatar

Chun-Ping (Jeremy) Chang mrmoneyc

View GitHub Profile
Gem::Version.new('0.3.2') < Gem::Version.new('0.10.1')
=> true
Gem::Version.new('0.3.0') == Gem::Version.new('0.3')
=> true
@mrmoneyc
mrmoneyc / prepare-commit-msg
Last active February 17, 2016 02:48 — forked from aemonge/prepare-commit-msg
Angular Commit Message Conventions git hook, so you got your commit prepared to with the messages they expect ;)
#!/bin/bash
# Angular Commit Message Conventions git hook
firstLine=`head -2 $1 | tail -1`
if [[ $firstLine == \#* ]]; then # Testing that the file starts with a comment, not yet a real commit ;)
echo '<type>(<scope/component>): <subject>' > .prepare-commit-msg-temp
echo '' >> .prepare-commit-msg-temp
echo '<body>' >> .prepare-commit-msg-temp
echo '' >> .prepare-commit-msg-temp
echo '<footer>' >> .prepare-commit-msg-temp
@mrmoneyc
mrmoneyc / hack.sh
Created February 15, 2014 17:33 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@mrmoneyc
mrmoneyc / hack.sh
Created December 8, 2013 06:37 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
<?php
define('NICKNAME', 'abc');
define('PASSWORD', 'iamabc');
define('USER_ID', '123456');
$message = 'Hello World!';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>
<meta name="format-detection" content="telephone=no"/>
<link rel="apple-touch-icon" href="/xhtml/images/favicon-57.png"/>
<style id="donotdelete">/*<![CDATA[*/
body{visibility:hidden;font-size:16px !important;margin:0 !important}#landingPage{visibility:hidden}#igoogle{text-align:right;margin-top:10px;margin-right:5px}.gp2{margin:0;text-align:center}.gp7{font-size:12pt;margin-top:5pt}#b{font-size:10pt;margin-top:4px;margin-bottom:5px}.gsc-tabHeader{margin:0;padding-top:0;padding-left:10px;padding-right:10px;padding-bottom:15px;border:none}.gsc-tabHeader.gsc-tabhActive{background:#fff;display:inline;color:#000;font