Skip to content

Instantly share code, notes, and snippets.

View pobing's full-sized avatar

Jed pobing

View GitHub Profile
@pobing
pobing / 大学.json
Created May 11, 2018 09:02 — forked from zerosrat/大学.json
中国大学名单
{
"湖南省": [
"湘潭大学",
"吉首大学",
"湖南大学",
"中南大学",
"湖南科技大学",
"长沙理工大学",
"湖南农业大学",
"中南林业科技大学",
@pobing
pobing / Preferences.sublime-settings
Created February 23, 2022 09:06
Preferences.sublime-settings of User
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"color_scheme": "Monokai.sublime-color-scheme",
"copy_with_empty_selection": true,
"dictionary": "Packages/Language - English/en_US.dic",
"ensure_newline_at_eof_on_save": true,
"font_size": 20,
"ignored_packages":
[
desc "update zone data"
task :find_bad_js => :environment do
JS_PATH = "/lit/app/assets/javascripts/**/*.js";
Dir[JS_PATH].each do |file_name|
puts "\n#{file_name}"
puts Uglifier.compile(File.read(file_name))
end
end
@pobing
pobing / gist:1369089
Last active July 12, 2018 09:34
Ubuntu下Git服务器安装与配置
Ubuntu下Git服务器安装与配置
1. 安装
1.1 安装Git-Core:
sudo apt-get install git-core
1.2 安装 Gitosis
sudo apt-get install python-setuptools
mkdir ~/src
cd ~/src
git clone git://eagain.net/gitosis
@pobing
pobing / gist:11238340
Last active July 4, 2018 10:16
ruby 使用HMAC算法得到加密字符串
#(1) 把timestamp和token联合;
# (2) 使用HMAC算法得到加密字符串(将appkey作为参数并使用SHA256 哈希方法);
# (3) 比较signature和得到的加密字符串。
timestamp = "1398236282767"
token = "THd78OwTxVGjTgCYSOxr4vkCPj3oIUg1TpZgkYpjerT2zNWdPQ"
signature = "df5fc888e86c8032f0c6b56e91ab91ebdfdae297e7a1dd4983e2e091042c151e"
data = timestamp + token
appkey = 'bl92t6tw-55zn-h14y-uzpd-y52k7jqe5s'
@pobing
pobing / golbal.coffee
Last active January 30, 2018 08:01
Some global Javascript method
window.TBS ||= {}
Date::format = (format) ->
o =
'M+': @getMonth() + 1
'd+': @getDate()
'h+': @getHours()
'm+': @getMinutes()
's+': @getSeconds()
'q+': Math.floor((@getMonth() + 3) / 3)
@pobing
pobing / rails_template.rb
Created March 23, 2017 10:14
use rails template create project
## Gem part
remove_file 'Gemfile'
run 'touch Gemfile'
add_source 'https://gems.ruby-china.org'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
@keyframes spin {
0% {
transform:rotate(0deg);
}
100% {
transform:rotate(360deg);
}
}
.animate-spin {
@pobing
pobing / checkboxSelect.coffee
Last active February 2, 2016 06:57
js checkAll or subCheck
attached: ->
$subQuestion = @$("input[name='question_ids[]']")
checkedLengh = @$("input[name='question_ids[]']:checked").length
allChecked = checkedLengh > 0 and $subQuestion.length is checkedLengh
@$(".question-check-all").prop("checked", allChecked)
checkAll: (e) ->
checkboxes = $('input[name="question_ids[]"]')
_.each checkboxes, (box) =>
@pobing
pobing / jsArraySort.coffee
Created February 2, 2016 06:55
js array sort by two propertys
comparator: (prev,next) ->
return 1 if prev.get('page_number') > next.get('page_number')
return -1 if prev.get('page_number') < next.get('page_number')
if prev.get('page_number') is next.get('page_number')
return prev.get('number') - next.get('number')
return 0