Skip to content

Instantly share code, notes, and snippets.

fangxing fffx

Block or report user

Report or block fffx

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
fffx / redis_cheatsheet.bash
Created Jan 17, 2019 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION -->
View redis_cheatsheet.bash
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
View deepin tim log.log
This file has been truncated, but you can view the full file.
ii deepin-wine-helper:i386 1.1deepin12 i386 Deepin Wine Hepler
ii deepin-wine-plugin 1.0deepin2 amd64 Deepin Wine plugin
ii deepin-wine-plugin-virtual 1.0deepin2 all Deepin Wine plugin virtual package
ii deepin-wine-uninstaller:i386 0.1deepin2 i386 Deepin Wine Uninstaller Tool
ii 5.5.4deepin8 i386 Baidu net disk client on Deepin Wine
rc 8.9.19983deepin23 i386 Tencent QQ Client on Deepin Wine
ii 7.9.14308deepin8 i386 Tencent QQ Client on Deepin Wine
fffx / gist:0beee2d5dc8142bff1670b15dedaccc9
Created Oct 25, 2018 — forked from ryanlecompte/gist:1283413
Providing an ActiveRecord-like before_filter capability to arbitrary Ruby classes
View gist:0beee2d5dc8142bff1670b15dedaccc9
# First the end result of what we want:
class Foo
before_hook :whoa
before_hook :amazing
def test
puts "This is kinda cool!"
fffx / gist:27eb438713aad0f8f0e3aeec877c2d09
Created Aug 26, 2018 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:27eb438713aad0f8f0e3aeec877c2d09


:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
fffx /
Created Jul 8, 2018 — forked from yang-wei/
ES6 destructing (and rest parameter)

We will first discussed how destructing and rest parameters can be used in ES6 - in arrays and objects. Then we will look at a few examples and also discuss some quiz.


var array = [1, 2, 3, 4];
var nestedArray = [1, 2, 3, 4, [7, 8, 9]];

var [a, b, c, d] = array;
console.log(a, b, c, d)
View post-checkout-example
#!/usr/bin/env bash
#!/bin/bash -xv # puts this line in the beginning for debug
# This hook, auto checkout related repo to corresponding branch
# Current branch
branch=$(git symbolic-ref --short HEAD)
# Dependended repos
repos=(dependened_repo_a dependened_repo_b)
fffx /
Created Jan 7, 2018 — forked from soheilhy/
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for,, and on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

fffx / weekend_day_count.rb
Last active Feb 1, 2018
a optimized way count weekend days
View weekend_day_count.rb
#!/usr/bin/env ruby
require 'date'
require 'benchmark'
def weekend_count(start_date, end_date)
size = (end_date - start_date).to_i
count = 0
if start_date.wday != 0
size -= (7 - start_date.wday).to_i
count += 1
fffx / pryrc
Created Nov 25, 2017
Add rvm gem_home to load_path on rails console
View pryrc
# Inspired by
if defined?(::Bundler)
current_gemset = ENV['GEM_HOME']
$LOAD_PATH.concat(Dir.glob("#{current_gemset}/gems/*/lib")) if current_gemset
fffx /
Created Nov 1, 2017
Rails load additional gem without modify your project gemfile

bundler load gemfile by look up ENV["BUNDLE_GEMFILE"] , so your can set this enviromental variable to another gemfile , let say local_gemfile, and then in your local_gemfil, first load the project gemfile, and then add your additional ges.

# local_gemfile

 gem 'other_gems'
You can’t perform that action at this time.