Skip to content

Instantly share code, notes, and snippets.

View romoo's full-sized avatar
💡
Working

Romoo romoo

💡
Working
  • Beijing, China
  • 20:48 (UTC +08:00)
  • X @romoo
View GitHub Profile
@adammiller
adammiller / douglasPeucker.js
Created February 14, 2011 16:54
Javascript implementation of the Douglas Peucker path simplification algorithm
var simplifyPath = function( points, tolerance ) {
// helper classes
var Vector = function( x, y ) {
this.x = x;
this.y = y;
};
var Line = function( p1, p2 ) {
this.p1 = p1;
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@artero
artero / launch_sublime_from_terminal.markdown
Last active May 15, 2024 03:38 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@necolas
necolas / README.md
Last active March 28, 2024 20:34
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name
@lancejpollard
lancejpollard / meta-tags.md
Created March 5, 2012 13:54
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@twosixcode
twosixcode / gist:1988097
Created March 6, 2012 18:40
Make "Paste and Indent" the default paste in Sublime Text 2
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@mybeky
mybeky / uncrush.sh
Created April 18, 2012 08:27
Restore iOS optimized PNG file.
# Create symbolic link first.
# ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush ~/bin/
# or
# ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush ~/bin/
# for old version Xcode.
find . -depth 1 -name '*.png' -exec pngcrush -revert-iphone-optimizations {} {}-o.png \;
@amdgigabyte
amdgigabyte / compress.sh
Created April 20, 2012 13:49
YUIcompressor Shell Script
#! /bin/bash
# YUI Compressor Bash Script
# @author qiaofu@taobao.com
# @version 0.1 2012-04-20
# 安装 #
# 1. 设置好你的JAVA_HOME环境变量
# 2. 在自己的家目录下面创建一个bin文件夹 ~/bin
# 2. 复制这个 compress.sh 以及 yuicompressor.jar 到 ~/bin,并执行
# chmod +x compress.sh(以保证compress.sh可执行)
@mockee
mockee / check_ctrip_price.js
Created May 5, 2012 15:18
Check the price of Ctrip tourism product
var http = require('http'),
jsdom = require('jsdom'),
nodemailer = require('nodemailer');
smtpTransport = nodemailer.createTransport('SMTP', {
service: 'Gmail',
auth: {
user: 'username@gmail.com',
pass: 'password'
}