Skip to content

Instantly share code, notes, and snippets.

Yanming Deng cisolarix

Block or report user

Report or block cisolarix

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
@cisolarix
cisolarix / mysql2-mojave.md
Created Apr 24, 2019 — forked from fernandoaleman/mysql2-mojave.md
Install mysql2 on MacOS Mojave
View mysql2-mojave.md

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
@cisolarix
cisolarix / dabblet.css
Created Nov 5, 2018
Vertical centering - Viewport unit method
View dabblet.css
/**
* Vertical centering - Viewport unit method
*/
main {
width: 18em;
padding: 1em 1.5em;
margin: 50vh auto 0;
transform: translateY(-50%);
box-sizing: border-box;
@cisolarix
cisolarix / config.rb
Created Aug 3, 2017 — forked from guiman/config.rb
Example mina deploy script using docker
View config.rb
require 'mina/git'
require 'mina/nginx'
set :application, 'your_app_name'
set :domain, 'your_server'
set :user, 'ubuntu'
set :deploy_to, '/location/to/deploy'
set :app_path, "#{deploy_to}/#{current_path}"
set :repository, 'your_repo'
set :branch, 'master'
@cisolarix
cisolarix / Readme.md
Created Jul 28, 2017 — forked from mxstbr/Readme.md
Enable tab completion for JSX with Emmet in Atom
View Readme.md

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
View live reload.md

bundle exec guard -P livereload

@cisolarix
cisolarix / xunlei_download_links_grabber.rb
Created May 10, 2015
xunlei_download_links_grabber
View xunlei_download_links_grabber.rb
View 学院(部门)信息.txt
江西经济发展研究院
研究生学院
校办公室
国际学院
档案馆
信息管理学院
资产管理处
外国语学院
马克思主义学院
老干处
View seeds.rb
unless Rails.env.production?
connection = ActiveRecord::Base.connection
connection.tables.each do |table|
connection.execute("TRUNCATE #{table}") unless table == "schema_migrations"
end
sql = File.read('db/import.sql')
statements = sql.split(/;$/)
statements.pop
@cisolarix
cisolarix / permission_actions.rb
Last active Aug 29, 2015
获取 permission actions 列表
View permission_actions.rb
controllers = Dir.new("#{Rails.root}/app/controllers/admin").entries
controllers.each do |controller|
if controller =~ /_controller/
cont = controller.camelize.gsub(".rb","")
cont1 = controller.gsub("_controller.rb", "")
(eval("Admin::#{cont}.action_methods")).sort.each {|met|
puts "admin/#{cont1}##{met}"
}
end
end
You can’t perform that action at this time.