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
yum -y groupinstall "Development Tools" | |
yum -y install gtk+-devel gtk2-devel | |
yum -y install libXpm-devel | |
yum -y install libpng-devel | |
yum -y install giflib-devel |
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
for x in reversed(range(10, 20)): os.system('git stash drop stash@{' + str(x) + '}') |
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
def test_options(size, options=nil) | |
puts "size is #{size}" | |
if options.nil? | |
return | |
end | |
options.each do | key, value| | |
puts "key is #{key}, value is #{value}" | |
end | |
end |
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
""" | |
Usage: python replace.py --show | |
""" | |
import optparse | |
import os | |
import fileinput | |
import sys | |
import re | |
class SolutionFile(object): |
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
Dir.glob('**/*') do |file_name| | |
# require 'byebug'; byebug | |
if file_name.to_s.include? "rhtml" | |
puts "--------------> " + file_name | |
file = File.open(file_name, 'r') | |
data = file.read | |
new_data = data.gsub("<%=", "<%= raw") | |
File.open(file_name, "w") { |file| file.puts new_data } | |
end | |
end |
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
package org.hfeng.oj.leet.anagrams; | |
import org.junit.Test; | |
import org.junit.Before; | |
import org.junit.After; | |
import java.util.Arrays; | |
import java.util.List; |
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
Acquire::http::proxy "http://proxy.company.com:80/"; | |
Acquire::https::proxy "https://proxy.company.com:80/"; | |
Acquire::ftp::proxy "ftp://proxy.company.com:80/"; |
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
filenames = ['ch1.org', 'ch10.org', 'ch11.org', 'ch12.org', 'ch13.org', 'ch14.org', 'ch2.org', 'ch3.org', 'ch4.org', 'ch5.org', 'ch6.org', 'ch7.org', 'ch8.org', 'ch9.org'] | |
# hfeng.py | |
with open('./hfeng.org','w') as outfile: | |
for fname in filenames: | |
with open(fname) as infile: | |
outfile.write(infile.read()) |
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
/* p is an element for HTML */ | |
p { | |
color: green; | |
} | |
/* blacktea is a class that one element p has */ | |
p.blacktea { | |
color: red; | |
} |
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
# Version: 0.0.1 | |
FROM ubuntu:14.04 | |
MAINTAINER Harri Feng "[email protected]" | |
RUN apt-get install -y nginx | |
RUN echo 'Hi, I am in your container'\ | |
>/usr/share/nginx/html/index.html | |
EXPOSE 80 |