Skip to content

Instantly share code, notes, and snippets.

View fuyi's full-sized avatar
🎯
Focusing

YI FU fuyi

🎯
Focusing
  • Stockholm, Sweden
View GitHub Profile
@fuyi
fuyi / gist:6494637
Created September 9, 2013 11:58
add ssh to heroku
first of all create a new rsa key:
ssh-keygen -t rsa -C "giordano.scalzo[at]gmail.com" -f ~/.ssh/id_rsa_heroku
then added to my machine
ssh-add ~/.ssh/id_rsa_heroku
and, finally, to Heroku
heroku keys:add ~/.ssh/id_rsa_heroku.pub
Feature: Sign up
In order to get access to protected sections of the site
As a user
I want to be able to sign up
Background: # features/users/sign_up.feature:6
Given I am not logged in # features/step_definitions/user_steps.rb:52
Invalid CSS after "...: scale(1.001, ": expected function argument, was ");"
(in /Applications/MAMP/htdocs/halo/app/assets/stylesheets/application.css) (ActionView::Template::Error)
(sass):1346
@fuyi
fuyi / gist:c7bccdb9e5f924da4c92
Last active August 29, 2015 14:12
git remove branch

To delete a local branch

git branch -d the_local_branch

To remove a remote branch (if you know what you are doing!)

git push origin :the_remote_branch

Someone else has already deleted the branch. try to synchronize your branch list with

class Competition < ActiveRecord::Base
PERCENTATE = 0.1
ON_FIRE_COUNT = 3
scope :on_going, -> { where('start_time < ? AND end_time > ?', Time.now(), Time.now()) }
scope :ended, -> { where('end_time < ?', Time.now()) }
scope :not_started_yet, -> { where('start_time > ?', Time.now()) }
scope :active, -> { where( status: 1)}
@fuyi
fuyi / gist:fc9dc4e6fb1d7c35865e
Created January 28, 2015 10:31
derailed_benchmark error
Yis-MacBook-Pro:halo yifu$ rake -f perf.rake perf:ram_over_time TEST_COUNT=10 --trace
** Invoke perf:ram_over_time (first_time)
** Invoke perf:setup (first_time)
** Execute perf:setup
Booting: production
** Execute perf:ram_over_time
PID: 7124
199.3203125
rake aborted!
Bad request:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = [email protected]:SpartaSales/halo.git
fetch = +refs/heads/*:refs/remotes/origin/*
@fuyi
fuyi / gist:52695dc7eef1e209236d
Created March 4, 2015 15:14
c66 toolbelt command
COMMANDS:
stacks commands to work with stacks
redeploy An alias for 'stacks redeploy' command
open opens the web browser to visit the app served by the stack
settings list and set stack settings
easydeploys commands to work with EasyDeploy
env-vars commands to work with environment variables
lease leases firewall access to the given server on the stack
run executes a command directly on the server
servers commands to work with servers
@fuyi
fuyi / gist:70381e901802ad2f410e
Last active August 29, 2015 14:17
cloud66 rails stack log location
nginx access log: /var/log/nginx/access.log
https auth log: /var/log/auth.log
nginx error log: /var/log/nginx/error.log
/var/deploy/halo/web_head/shared/log/nginx_error.log
unicorn error log: /var/deploy/halo/web_head/shared/log/unicorn.stderr.log
/var/deploy/halo/web_head/shared/log/unicorn.stdout.log
rails web log: /var/deploy/halo/web_head/shared/log/production.log
rails worker log: /var/deploy/halo/web_head/shared/log/user_worker_1.log
@fuyi
fuyi / gist:96c5b5209100a3b03ced
Last active October 5, 2015 06:22
Expectations Sparta responsibilities
CEO:
set company vision and keep all team members are on the same page
clearly identify roles and responsibilities of each team member
recruit best people to join the team
always think about how to grow the company into next level
keep a eye on each department and make sure every department is working smoothly
build company level culture, keep the team momentum high
follow up competitors, make competition strategy
pass information/decision from board meeting to the team
report company progress and status to board and investors
@fuyi
fuyi / gist:02a256249d4799a04dae
Created September 9, 2015 17:34
Customer Success
customer success -> sparta success dedicated people
How to make customer happy?
upsale cover churn rate
Define feature categories for each plan