Skip to content

Instantly share code, notes, and snippets.

Eric Guo Eric-Guo

Block or report user

Report or block Eric-Guo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Eric-Guo
Eric-Guo / ruby_gems_age.rb
Created Aug 18, 2019 — forked from borama/ruby_gems_age.rb
A script that collects and prints info about the age of all ruby gems in your project, see https://dev.to/borama/how-old-are-dependencies-in-your-ruby-project-3jia
View ruby_gems_age.rb
#!/bin/env ruby
#
# Collects info about the age of all gems in the project
#
require "json"
require "date"
bundle = `bundle list`
yearly_stats = {}
@Eric-Guo
Eric-Guo / rails-docker-build-speed-up.md
Created Jun 28, 2019 — forked from huacnlee/rails-docker-build-speed-up.md
给 Rails 应用 Docker Image 打包过程增加 cache,依靠 GitLab CI 的 cache 来加速
View rails-docker-build-speed-up.md

.yarnrc

我们需要在 Rails 项目根目录配置 .yarnrc 告诉 Yarn 我们需要将 npm 的包缓存到 vendor/cache/npm 目录。

registry "https://registry.npm.taobao.org"
lastUpdateCheck 1561690751463
yarn-offline-mirror "./vendor/cache/npm"     
yarn-offline-mirror-pruning true
@Eric-Guo
Eric-Guo / decode_session_cookie.rb
Created Sep 11, 2018 — forked from profh/decode_session_cookie.rb
A simple script to decode Rails 4 session cookies
View decode_session_cookie.rb
View homebrew-core_Formula_ruby.rb
class Ruby < Formula
desc "Powerful, clean, object-oriented scripting language"
homepage "https://www.ruby-lang.org/"
url "https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.4.tar.xz"
sha256 "1d0034071d675193ca769f64c91827e5f54cb3a7962316a41d5217c7bc6949f0"
revision 1
bottle do
sha256 "f65d0a31c1149e479ec84c9953ac203d65c0f931b9ab346efae58faed468afda" => :high_sierra
sha256 "97d54b2626c04642997487f06819332c10a6eb62c700a1861d0c3535ce8a3411" => :sierra
@Eric-Guo
Eric-Guo / action_mailer-dont_log_attachments.rb
Last active Oct 19, 2017 — forked from TylerRick/action_mailer-dont_log_attachments.rb
Override the version from the actionmailer gem in order to not log attachments.
View action_mailer-dont_log_attachments.rb
ActionMailer::Base.class_eval do
class << self
protected
# Override the version from the actionmailer gem in order to not log attachments.
#
def set_payload_for_mail(payload, mail) #:nodoc:
payload[:mailer] = name
payload[:message_id] = mail.message_id
payload[:subject] = mail.subject
@Eric-Guo
Eric-Guo / export_detail_address.rb
Created Oct 14, 2017
Export account from salesforce
View export_detail_address.rb
require 'restforce'
require 'csv'
client = Restforce.new :username => 'admin@bayekeji.com',
:password => '',
:client_id => '3MVG9Z',
:client_secret => '8211'
hsh_ary = client.query("select Id, LastName, DetailAddress__c from account where DetailAddress__c != null")
View rails-cookie-decrypt.go
View .circleci-config.yml
version: 2
jobs:
build:
working_directory: ~/mowers
docker:
- image: circleci/ruby:2.4.1-node
environment:
PGHOST: 127.0.0.1
PGUSER: mower
RAILS_ENV: test
View intl_to_cn.js
var orig = [
[
"Afghanistan (‫افغانستان‬‎)",
"af",
"93"
],
[
"Albania (Shqipëri)",
"al",
"355"
View keybase.md

Keybase proof

I hereby claim:

  • I am Eric-Guo on github.
  • I am ericguo (https://keybase.io/ericguo) on keybase.
  • I have a public key whose fingerprint is 3017 E111 4D24 D4AD 19AD 34B3 4631 036D 2383 8650

To claim this, I am signing this object:

You can’t perform that action at this time.