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
class Helloworld | |
def call(env) | |
[200, {'Content-Type' => 'text/plain'}, ['hello world!']] | |
end | |
end | |
run Helloworld.new |
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
$ gedit | |
Traceback (most recent call last): | |
File "/usr/lib/gedit-2/plugins/advanced-bookmarks/plugin.py", line 62, in activate | |
self._instances[window] = window_helper.window_helper(self, window, self._bookmarks, self._config) | |
AttributeError: 'AdvancedBookmarksPlugin' object has no attribute '_bookmarks' | |
Traceback (most recent call last): | |
File "/usr/lib/gedit-2/plugins/advanced-bookmarks/plugin.py", line 69, in update_ui | |
self._instances[window].update_ui() | |
KeyError: <gedit.Window object at 0x2305910 (GeditWindow at 0x1bac0c0)> | |
Traceback (most recent call last): |
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
irb(main):001:0> a = Object.new | |
=> #<Object:0x7ff7a6ff6388> | |
irb(main):002:0> a.object_id #获取对象ID | |
=> 70350817702340 | |
irb(main):003:0> a.class #获取对象类型 | |
=> Object | |
irb(main):004:0> Integer.superclass #获取父类 | |
=> Numeric | |
irb(main):006:0> Numeric.superclass #... | |
=> 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
;;;;;;;;;;;;;;;;;;;;; | |
; FPM Configuration ; | |
;;;;;;;;;;;;;;;;;;;;; | |
; All relative paths in this configuration file are relative to PHP's install | |
; prefix. | |
; Include one or more files. If glob(3) exists, it is used to include a bunch of | |
; files from a glob(3) pattern. This directive can be used everywhere in the | |
; file. |
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
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(TeX-PDF-mode t) | |
'(auto-compression-mode t nil (jka-compr)) | |
'(browse-url-browser-function 'browse-url-firefox) | |
'(c-offsets-alist | |
'((arglist-intro . +) |
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
class A; attr_accessor :b; end | |
class B; attr_accessor :a; end | |
a = A.new | |
b = B.new | |
a.b = b | |
b.a = a | |
puts a.to_yaml | |
# --- &id001 !ruby/object:A | |
# b: !ruby/object:B | |
# a: *id001 |
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/sh | |
set -e | |
if [ $# != 1 ]; then | |
echo "Usage: `basename $0` FOO.rar" | |
exit 2 | |
fi | |
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 com.lidaobing.niotest.bin; | |
import java.net.InetSocketAddress; | |
import java.util.concurrent.Executors; | |
import org.jboss.netty.bootstrap.ServerBootstrap; | |
import org.jboss.netty.channel.ChannelHandlerContext; | |
import org.jboss.netty.channel.ChannelPipeline; | |
import org.jboss.netty.channel.ChannelPipelineFactory; | |
import org.jboss.netty.channel.Channels; |
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 com.lidaobing.niotest.bin; | |
import org.jboss.netty.channel.ChannelHandlerContext; | |
import org.jboss.netty.channel.ExceptionEvent; | |
import org.jboss.netty.channel.MessageEvent; | |
import org.jboss.netty.channel.SimpleChannelUpstreamHandler; | |
public class EchoHandler extends SimpleChannelUpstreamHandler { | |
@Override | |
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# set PATH so it includes user's private bin if it exists | |
if [ -d ~/bin ] ; then | |
PATH=~/bin:"${PATH}" | |
fi | |
if [ -d ~/.local/bin ]; then |