Skip to content

Instantly share code, notes, and snippets.

@jhjguxin
jhjguxin / Activate Office 2019 for macOS VoL.md
Created October 5, 2023 14:23 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@jhjguxin
jhjguxin / puppeteer.md
Created April 4, 2019 03:03
headless browser
@jhjguxin
jhjguxin / ringbuffer.rb
Created October 29, 2018 12:00 — forked from eerohele/ringbuffer.rb
A simple ring buffer for Ruby.
class RingBuffer < Array
attr_reader :max_size
def initialize(max_size, enum = nil)
@max_size = max_size
enum.each { |e| self << e } if enum
end
def <<(el)
if self.size < @max_size || @max_size.nil?
@jhjguxin
jhjguxin / unicorn.rb
Created September 8, 2016 02:23 — forked from ak47/unicorn.rb
force figaro ENV vars to reload on unicorn USR2 restarts
root = "/var/www/cake/current"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.stderr.log"
stdout_path "#{root}/log/unicorn.log"
listen "/tmp/unicorn.cake.sock"
worker_processes 2
timeout 15
@jhjguxin
jhjguxin / gist:b359d96e8c2452d8a6cd18678c0e8440
Last active April 20, 2016 15:15
make a Virtual Router (soft wifi host ap) Ubuntu 15
```sh
#/bin/bash!
# sudo apt-get install hostapd
# git clone https://github.com/oblique/create_ap.git && cd create_ap
# sudo make install
iwconfig
sudo create_ap wlp3s0 enp4s0f0 francis-ubuntu aaabbbccc123
```
@jhjguxin
jhjguxin / gist:942131cc6795cbf98ceb
Created January 26, 2016 16:27 — forked from donnierayjones/LICENSE
Render Bootstrap as "small" layout when printing
@media print {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left;
}
.col-sm-12 {
width: 100%;
}
.col-sm-11 {
width: 91.66666667%;
}
@jhjguxin
jhjguxin / number_to_chinese_amount_in_words_helper.rb
Created January 11, 2016 10:18
NumberToCapitalZh 数字转成中文大写金额
module NumberToChineseAmountInWordsHelper
# Formats a +number+ into a chinese amount in words(e.g., 壹万元整).
#
# === Examples
# number_to_capital_zh(10001.00) # => '壹万元整',
# number_to_capital_zh(100000.10) # => '壹拾万元壹角整',
# number_to_capital_zh(0.1) # => '壹角整',
# number_to_capital_zh(1.11) # => '壹元壹角壹分',
# number_to_capital_zh(1.01) # => '壹元零壹分',
# number_to_capital_zh(0.01) # => '壹分',
@jhjguxin
jhjguxin / linebreak.rb
Created October 27, 2015 07:18 — forked from niallsmart/linebreak.rb
Axlsx line break
require 'axlsx'
Axlsx::Package.new do |package|
workbook = package.workbook
workbook.add_worksheet do |sheet|
wrap = workbook.styles.add_style alignment: {wrap_text: true}
sheet.add_row ["Foo\r\nBar", "Foo\rBar", "Foo\nBar", "Foo\n\r\nBar"], style: wrap
end
package.serialize "linebreak.xlsx"
@jhjguxin
jhjguxin / deploy.rb
Last active May 10, 2019 03:37
use qiniu to speed up your site asset file load time
set :linked_files, %W{
... config/app.god config/qrsync.json
config/application.yml
}
# you should remove bin from linked_dirs config
# https://github.com/capistrano/bundler/issues/45
set :linked_dirs, %w{config/unicorn log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
namespace :deploy do
@jhjguxin
jhjguxin / install_mysql_5_5_centos.md
Last active September 27, 2017 02:50
Install MySQL Database 5.5.37 on CentOS 6.5/5.10, Red Hat (RHEL) 6.5/5.10

Install MySQL Database 5.5.37 on CentOS 6.5/5.10, Red Hat (RHEL) 6.5/5.10

1.change user

su

2.Install Remi repository