Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am dfguo on github.
  • I am dfguo (https://keybase.io/dfguo) on keybase.
  • I have a public key ASA4GUMGTARox8XhCj8wpooINLPYTJHCEN93PnQxwlyZYgo

To claim this, I am signing this object:

View Sources.List
##### DEBIAN ################
# Debian Experimental
# deb http://ftp.de.debian.org/debian experimental main contrib non-free
# deb-src http://ftp.de.debian.org/debian experimental main contrib
# Debian Sid # CURRENT UNSTABLE
# deb http://ftp.de.debian.org/debian sid main contrib non-free
# deb-src http://ftp.de.debian.org/debian sid main contrib non-free
# Debian 8.0 (Jessie) # CURRENT TESTING
@dfguo
dfguo / Enhance.js
Last active Dec 12, 2015 — forked from sebmarkbage/Enhance.js
Higher-order Components
View Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: 'Hello' };
}
render() {
return <ComposedComponent {...this.props} data={this.state.data} />;
}
};
@dfguo
dfguo / cloudinary_remove.js
Created Jan 10, 2014
remove cloudinary images when you are in the search image page
View cloudinary_remove.js
$.each($('.public_id'), function(i, item) {
key = $(item).attr('title');
$.ajax({
url: 'https://cloudinary.com/console/media_library/delete_resource',
type: 'DELETE',
data: "public_id=" + key + "&type=upload",
success: function(result) {
console.log(key + " deleted.");
}
});
@dfguo
dfguo / fresh
Created Sep 19, 2013
sample page data json
View fresh
{"type":"PageData","id":null,"horizontal":false,"showNav":true,"navFont":"","titleFont":"","logoFont":"","bodyFont":"","headingFont":"","fixedSocialMedia":false,"showButtons":true,"slides":[{"type":"Slide","id":null,"template_id":null,"template_name":"fresh_html_section","components":{"slideSettings":{"type":"SlideSettings","id":null,"name":"Apps","show_nav":true},"background":{"type":"BackgroundImage","id":null,"link_url":"","thumb_url":"","url":"http://uploads.striking.ly/page/images/backgrounds/bg6.jpg","original_url":"","image_type":"background","caption":"","description":"","new_target":true,"style":"cover","color":null,"opacity":0.3,"textStyles":[{"type":"TextStyle","displayName":"Light Text","colorCode":"#ffffff","className":"strikingly-light-text"},{"type":"TextStyle","displayName":"Dark Text","colorCode":"#222222","className":"strikingly-dark-text"}],"selectedClassName":"strikingly-light-text"},"html_component":{"type":"HtmlComponent","id":6842,"value":"&lt;div id=\"fb-root\"&gt;&lt;/div&gt;&lt;scrip
View error_gettext
xiting
/Users/dafeng/.rvm/gems/ruby-1.9.3-p385@bobcat/gems/i18n-0.6.4/lib/i18n/backend/base.rb:163:in `load_file': can not load translations from /Users/dafeng/Code/Bobcat/config/locales/model_attributes.rb: expects it to return a hash, but does not (I18n::InvalidLocaleData)
from /Users/dafeng/.rvm/gems/ruby-1.9.3-p385@bobcat/gems/i18n-0.6.4/lib/i18n/backend/base.rb:15:in `block in load_translations'
from /Users/dafeng/.rvm/gems/ruby-1.9.3-p385@bobcat/gems/i18n-0.6.4/lib/i18n/backend/base.rb:15:in `each'
from /Users/dafeng/.rvm/gems/ruby-1.9.3-p385@bobcat/gems/i18n-0.6.4/lib/i18n/backend/base.rb:15:in `load_translations'
from /Users/dafeng/.rvm/gems/ruby-1.9.3-p385@bobcat/gems/i18n-0.6.4/lib/i18n/backend/simple.rb:57:in `init_translations'
from /Users/dafeng/.rvm/gems/ruby-1.9.3-p385@bobcat/gems/i18n-0.6.4/lib/i18n/backend/simple.rb:71:in `lookup'
from /Users/dafeng/.rvm/gems/ruby-1.9.3-p385@bobcat/gems/i18n-0.6.4/lib/i18n/backend/base.rb:26:in `translate'
from /Users/dafeng/.rvm/gems/ruby-1.9.3-p385@
@dfguo
dfguo / gist:5112806
Created Mar 7, 2013
therubyracer segfault
View gist:5112806
2013-03-07T22:48:43+00:00 app[web.3]: Started GET "/s/pages/osujuniorday/edit/?s=1362361766180" for 139.78.253.119 at 2013-03-07 14:48:43 -0800
2013-03-07T22:48:43+00:00 app[web.3]: /app/vendor/bundle/ruby/1.9.1/gems/therubyracer-0.9.10/lib/v8/portal/proxies.rb:145: [BUG] Segmentation fault
2013-03-07T22:48:43+00:00 app[web.3]: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
2013-03-07T22:48:43+00:00 app[web.3]:
2013-03-07T22:48:43+00:00 app[web.3]: -- Control frame information -----------------------------------------------
2013-03-07T22:48:43+00:00 app[web.3]: c:0143 p:---- s:0719 b:0719 l:000718 d:000718 CFUNC :delete
2013-03-07T22:48:43+00:00 app[web.3]: c:0142 p:0045 s:0715 b:0715 l:000714 d:000714 METHOD /app/vendor/bundle/ruby/1.9.1/gems/therubyracer-0.9.10/lib/v8/portal/proxies.rb:145
2013-03-07T22:48:43+00:00 app[web.3]: c:0141 p:---- s:0710 b:0710 l:000709 d:000709 FINISH
2013-03-07T22:48:43+00:00 app[web.3]: c:0140 p:0011 s:0708 b:0708 l:001820 d:000707 BLOCK /app/app/views/pages/edit.
@dfguo
dfguo / app.rb
Created Nov 5, 2012 — forked from cpatni/app.rb
unique calculation using redis
View app.rb
require 'sinatra'
require 'redis'
require 'json'
require 'date'
class String
def &(str)
result = ''
result.force_encoding("BINARY")
You can’t perform that action at this time.