Skip to content

Instantly share code, notes, and snippets.

View gutenye's full-sized avatar
:octocat:
Guten tag!

Guten gutenye

:octocat:
Guten tag!
View GitHub Profile
@gutenye
gutenye / gist:9410464
Last active August 29, 2015 13:57
strongvpn log. by openvpn
Fri Mar 7 19:24:27 2014 OpenVPN 2.3.2 x86_64-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [eurephia] [MH] [IPv6] built on Nov 13 2013
Fri Mar 7 19:24:27 2014 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Fri Mar 7 19:24:27 2014 Control Channel Authentication: tls-auth using INLINE static key file
Fri Mar 7 19:24:27 2014 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri Mar 7 19:24:27 2014 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri Mar 7 19:24:27 2014 Socket Buffers: R=[212992->131072] S=[212992->131072]
Fri Mar 7 19:24:27 2014 UDPv4 link local: [undef]
Fri Mar 7 19:24:27 2014 UDPv4 link remote: [AF_INET]68.68.33.126:123
Fri Mar 7 19:24:27 2014 TLS: Initial packet from [AF_INET]68.68.33.126:123, sid=dd58390e 0e1906fb
Fri Mar 7 19:24:30 2014 VERIFY OK: depth=1, C=US, ST=CA, L=San-Francisco, O=reliablehosting.co
@gutenye
gutenye / gist:9410589
Last active August 29, 2015 13:57
wget both http and https website after/before stronvpn connection.
#
# without strongvpn, direct connect
#
/tmp ❯ wget http://www.engadget.com/
--2014-03-07 20:23:07-- http://www.engadget.com/
Resolving www.engadget.com (www.engadget.com)... 207.200.74.123
Connecting to www.engadget.com (www.engadget.com)|207.200.74.123|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
@gutenye
gutenye / gist:9733735
Created March 24, 2014 03:39
database query
Started GET "/api/v1/channels?featured=true&auth_token=BzbsZNWneZPToi95GryR&channel_id=-1" for 127.0.0.1 at 2014-03-24 11:38:28 +0800
Processing by Api::V1::ChannelsController#index as JSON
Parameters: {"featured"=>"true", "auth_token"=>"BzbsZNWneZPToi95GryR", "channel_id"=>"-1"}
User Load (1.3ms) SELECT "users".* FROM "users" WHERE "users"."authentication_token" = 'BzbsZNWneZPToi95GryR' LIMIT 1
(0.3ms) BEGIN
SQL (0.9ms) UPDATE "users" SET "last_sign_in_at" = $1, "current_sign_in_at" = $2, "sign_in_count" = $3, "updated_at" = $4 WHERE "users"."id" = 2 [["last_sign_in_at", Mon, 24 Mar 2014 03:38:28 UTC +00:00], ["current_sign_in_at", Mon, 24 Mar 2014 03:38:28 UTC +00:00], ["sign_in_count", 865], ["updated_at", Mon, 24 Mar 2014 03:38:28 UTC +00:00]]
(3.2ms) COMMIT
Channel Load (1.2ms) SELECT "channels".* FROM "channels" WHERE "channels"."featured" = 't' AND (author_id = 2 OR (accessible_to_all = 't' AND approved = 't'))
Page Load (0.7ms) SELECT "pages".* FROM "pages" WHERE "pages"."channe
@gutenye
gutenye / gist:9757635
Last active August 29, 2015 13:57
javascript basic
a = function() {
console.log(1)
}
a() // run it
console.log(2)
// 同步的 结果是
// 1
// 2
@gutenye
gutenye / a.html
Last active August 29, 2015 13:57
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Ember Hello</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script>
<script src="http://builds.emberjs.com/tags/v1.4.0/ember.min.js"></script>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Ember Hello</title>
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script>
<script src="http://builds.emberjs.com/tags/v1.4.0/ember.min.js"></script>
@gutenye
gutenye / a.md
Last active August 29, 2015 13:57
ember basic
App.IndexRoute = Ember.Route.extend({
  model: function() {
    return Ember.Object.create({name: 1})
  },
  
  setupController: function(controller, model) {        // 他省略了setupController
    controller.set('model', model)                     // 这里的model就是上面的 Ember.Object.create({name: 1})
    controller.set('age', 2)                           // 模板里面 {{age}}
 }
@gutenye
gutenye / gist:882616
Created March 23, 2011 04:25
write bundler into .gemspec file instead of using 'gemspec'
# a.gemspec
require "bundler"
Gem::Specification.new do |s|
s.name = "hello"
....
s.add_bundler_dependencies
end
@gutenye
gutenye / gist:1108486
Created July 27, 2011 01:38
Ruby Style Guide
Original Source: https://github.com/chneukirchen/styleguide
= Christian Neukirchen's Ruby Style Guide
You may not like all rules presented here, but they work very well for
me and have helped producing high quality code. Everyone is free to
code however they want, write and follow their own style guides, but
when you contribute to my code, please follow these rules:
(process:9963): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
(qq:9963): GdkPixbuf-CRITICAL **: gdk_pixbuf_add_alpha: assertion `GDK_IS_PIXBUF (pixbuf)' failed
(qq:9963): GdkPixbuf-CRITICAL **: gdk_pixbuf_copy_area: assertion `src_pixbuf != NULL' failed
(qq:9963): GdkPixbuf-CRITICAL **: gdk_pixbuf_copy_area: assertion `src_pixbuf != NULL' failed
(qq:9963): GdkPixbuf-CRITICAL **: gdk_pixbuf_copy_area: assertion `src_pixbuf != NULL' failed