This file contains hidden or 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-*- | |
//---------------------------------------------------------- | |
// module: 1132 | |
//---------------------------------------------------------- | |
#include <cstdio> | |
#include <cmath> | |
#include <algorithm> | |
#include <vector> |
This file contains hidden or 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/sh | |
### BEGIN INIT INFO | |
# Provides: god | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: God | |
### END INIT INFO |
This file contains hidden or 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
mylib.close_to_tray = -> | |
gui = require('nw.gui') | |
win = gui.Window.get() | |
tray = null | |
win.on 'close', -> | |
this.hide() | |
tray = new gui.Tray({ icon: 'icon.jpg' }) |
This file contains hidden or 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 'benchmark' | |
a = (1..1000).to_a | |
lookup = 100000.times.map{(rand*1000).to_i} | |
puts "for index" | |
puts Benchmark.measure { | |
lookup.each{ |i| a.index(i) } |
This file contains hidden or 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
filename = 'a.mp4' | |
target_path = '../processing' | |
(1..8).each do |i| | |
t = i * 60 | |
target_file = File.join(target_path, "#{i}.jpg") | |
`avconv -i #{filename} -ss #{t} -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 '#{target_file}'` | |
end | |
image_files = File.join target_path, '*.jpg' | |
`convert -delay 50 -loop 0 #{image_files} #{filename}.gif` |
This file contains hidden or 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/sh | |
# run | |
# curl http://ow.ly/JI3j3 | sh | |
mkdir -p /tmp/chef-install && cd /tmp/chef-install | |
wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.4.0-1_amd64.deb | |
sudo dpkg -i *.deb | |
cd && rm -rf /tmp/chef-install |
This file contains hidden or 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 make_preview_html | |
preview_path = 'preview' | |
styles = """ | |
body .blk { | |
margin: 0 10px 10px 0; | |
display: inline-block; | |
} | |
body .blk img { | |
width: 160px; |
This file contains hidden or 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
function autoReply() { | |
var scheduled_date = [ | |
'2016-12-19', '2016-12-20', | |
]; | |
var auto_reply = "I am out of office. Your email will not seen until Monday morning."; | |
var now = new Date(); | |
var today = now.toISOString().slice(0, 10); // today format: '2017-01-01' | |
var label = GmailApp.getUserLabelByName('auto-replyed') || GmailApp.createLabel('auto-replyed'); |
This file contains hidden or 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
# copy from https://github.com/macournoyer/thin/pull/184#issuecomment-191119259 | |
[Unit] | |
Description=haterslist | |
After=syslog.target network.target | |
[Service] | |
Type=forking | |
User=production | |
Group=production |
This file contains hidden or 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
今天我把母亲赶出了家门 | |
updated on Tue May 30, 2017 22:00 by 扬帆远航 via 一个哲学家的财务自由之路 | |
Translate article | |
就在今天上午,我把母亲赶出了家门,我感到如释重负,因为我已经忍受了这么多年,觉得自己实在不该再忍了,就做出了这样的决定。 | |
我这里把前因后果谈一谈,其最初的缘由,我已经在另一篇文章《我家是如何从富裕走向赤贫的》做过叙述,这里主要讲近几年发生的事情。 |