This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.eclipse.swt.SWT | |
import org.eclipse.swt.widgets.{Shell, Display, ToolItem, ToolBar, Listener, Event} | |
import org.eclipse.swt.browser.Browser | |
import org.eclipse.swt.layout._ | |
import scala.util.matching.Regex | |
import scala.xml._ | |
import org.w3c.tidy.Tidy | |
import java.io._ | |
object Remword2YouDao { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
The is a recusive approach solving the vectors combination problem | |
""" | |
# Y for yellow, G for green | |
# 1 2 3 4 for size | |
# H for heavy, L for light, O for overweight | |
vectors = [['Y', 'G'], | |
[1, 2, 3, 4], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* List the with parent and child relationship | |
*/ | |
object ImapFolders extends App { | |
val folders = List( | |
"mail201.udomain.com.hk.Winway", | |
"mail201.udomain.com.hk.Winway.Quota", | |
"mail201.udomain.com.hk.Winway.Delivery", | |
"mail201.udomain.com.hk.Winway.PO", | |
"mail201.udomain.com.hk.UA", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.NotificationView = Backbone.View.extend({ | |
targetElement:'#message' | |
tagName: 'div' | |
className: 'notification' | |
defaultMessages: | |
'success': 'Success!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.productSlide = (options) -> | |
settings = | |
width: 250 | |
container: "slide-container" | |
# space left to display part of another photo | |
edge: 30 | |
imageWidth: 190 | |
settings = $.extend settings, options | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openstack::region: 'openstack' | |
######## Networks | |
openstack::network::api: '192.168.100.0/24' | |
openstack::network::external: '192.168.100.0/24' | |
openstack::network::management: '10.10.10.0/24' | |
openstack::network::data: '10.20.20.0/24' | |
openstack::network::external::ippool::start: 192.168.100.100 | |
openstack::network::external::ippool::end: 192.168.100.200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Playframework is amazing | |
# | |
# chkconfig: 2345 20 80 | |
# description: Playframework initd script for udomain vmware api | |
# | |
# ========================================================================= | |
# Copyright 2014 Rado Buransky, Dominion Marine Media | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Template composition with inclusion | |
Every template language I have seen provides some mechanism for one template to include another, thus supporting the reuse of repeated elements like headers and footers. The included templates are called partials in Mustache parlance: | |
```html | |
<!-- home.hbs --> | |
<html> | |
<body> | |
{{> header}} | |
<p> HOME </p> | |
{{> footer}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo openvpn --config *.opvn | |
apt-get update | |
apt-get install vim | |
wget http://d3kbcqa49mib13.cloudfront.net/spark-1.3.0-bin-hadoop2.4.tgz | tar zxf | |
hadoop fs -mkdir /spark | |
hadoop fs -put spark-1.3.0-bin-hadoop2.4.tgz /spark | |
hadoop fs -du -h /spark | |
cp spark-env.sh.template spark-env.sh | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require modules | |
var express = require('express'), | |
i18n = require('i18n'), | |
hbs = require('hbs'), | |
app = module.exports = express(); | |
i18n.configure({ | |
locales: ['en', 'fr'], | |
cookie: 'locale', | |
directory: "" + __dirname + "/locales" |
OlderNewer