This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
# Install compile toolchain | |
sudo apt-get install autoconf patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev | |
# Install tools | |
sudo apt install vim tmux net-tools mysql-client mysql-server redis git tig tree htop neofetch | |
# Install fonts | |
sudo apt install fonts-noto-cjk fonts-noto-cjk-extra fonts-jetbrains-mono fonts-firacode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
# Install compile toolchain | |
sudo apt-get install autoconf patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev \ | |
libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev ntpdate | |
# Support AppImages app, Such as jetbrains-toolbox | |
sudo add-apt-repository universe | |
sudo apt install libfuse2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://docs.rubygems.org/read/chapter/11 | |
--- | |
gem: --no-ri --no-rdoc | |
benchmark: false | |
verbose: true | |
update_sources: true | |
sources: | |
- http://gems.rubyforge.org/ | |
- http://rubygems.org/ | |
backtrace: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a new file in your home directory called .gtkrc-eclipse | |
# call eclipse with this command: | |
# Gtk2 forced: | |
# export SWT_GTK3=0 | |
# env GTK2_RC_FILES=/usr/share/themes/<YourTheme>/gtk-2.0/gtkrc:/home/<YourUser>/.gtkrc-eclipse '/path_to_eclipse/eclipse' | |
# In your Eclipse directory find the file 'e4_default_gtk.css' | |
# In this file there's a CSS class: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo '***** Build tools *****' | |
sudo apt install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev | |
echo '***** Dev tools *****' | |
sudo apt install -y git gitg tmux vim-gnome exuberant-ctags memcached redis-server\ | |
mysql-server mongodb postgresql haskell-platform libmysqlclient-dev ipython python-dev\ | |
libsqlite3-dev ubuntu-make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
# Proxy | |
proxy_server = 'xxx.xxx.xxx.xxx' | |
proxy_port = 81 | |
## Example 1 | |
Net::HTTP.new('baidu.com', nil, proxy_server, proxy_port).start { |http| http.get '/' } | |
## Example 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bundler/setup' | |
require 'rack' | |
require 'pry' | |
module Nancy | |
METHODS = %w(get post put patch delete head) | |
class Base |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://robots.thoughtbot.com/writing-a-domain-specific-language-in-ruby | |
module Smokestack | |
@registry = {} | |
def self.registry | |
@registry | |
end | |
def self.define(&block) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# 1. Put this file in config/locales/kaminari/zh-CN.yml | |
# 2. Set load_path in config/application.rb as below: | |
# config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s] | |
zh-CN: | |
views: | |
pagination: | |
first: "« 首页" | |
last: "末页 »" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate Private Key: | |
openssl genrsa -out server.key 1024 | |
# Generate a Certificate Signing Request (CSR) | |
openssl req -new -key server.key -out server.csr | |
# Generate a Self-Signed SSL Certificate | |
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt |
NewerOlder