Skip to content

Instantly share code, notes, and snippets.

View ScorpiusZ's full-sized avatar

ScorpiusZ ScorpiusZ

View GitHub Profile
func config(callback: @escaping (Config) -> () ){
request("/v1/configurations", callback: callback)
}
{"members":[{"id":"c983cb178eaf430f68f179849c04ec24","sex":1,"nickname":"漂流瓶","height":162,"age":45,"avatar":"http://img.miliantech.com/uploads/member_avatar/avatar/297177/18829685596d0004459775017b833e51.jpeg@!size-normal","vip":false},{"id":"c9db78db7a3cffd97128ee7e913b175d","sex":1,"nickname":"聪明的小鸭子","height":166,"age":41,"avatar":"http://img.miliantech.com/uploads/member_avatar/avatar/462364/6c23c871cd14273267cc347429683f17.jpg@!size-normal","vip":false},{"id":"a22975317f619357aea4754d83b77c5a","sex":1,"nickname":"陈洪","height":165,"age":45,"avatar":"http://img.miliantech.com/uploads/member_avatar/avatar/314035/2aca4b7eb43bff56bec0c393849bdb13.jpeg@!size-normal","vip":false},{"id":"9787980aa3644e9156844d3d0c884b25","sex":1,"nickname":"安心","height":158,"age":48,"avatar":"http://img.miliantech.com/uploads/member_avatar/avatar/316650/37baa347e8c815055f2c7daef82b95ed.png@!size-normal","vip":false},{"id":"dbfb21e529b85ef2ed39f74b15b8e0db","sex":1,"nickname":"等待","height":160,"age":47,"avatar":"http://img.milia

##Apps

  • brew cask search markdown
  • brew cask install shadowsocksx-ng
  • brew cask install wireshark
  • brew cask install telegram
  • brew cask install jd-gui
  • brew cask install google-chrome
  • brew cask install dropbox
  • brew cask install android-studio
  • brew cask install the-unarchiver
<!DOCTYPE html>
<html>
<meta http-equiv=Content-Type content="text/html;charset=utf-8">
<head>
<title>test</title>
</head>
<body>
<pre id="lines" data-lining>
print("Hello, WWDC!")
Hello love at first swipe.
@ScorpiusZ
ScorpiusZ / word_search.rb
Last active March 10, 2016 09:15
word_search
def next_moves(current,paths,board)
[[-1,0],[1,0],[0,-1],[0,1]].map{|walk| [(current[0]+walk[0]),(current[1]+walk[1])]}.select do |next_pos|
!(paths.include? next_pos) and next_pos.all?{|pos| pos >=0 } and next_pos[0] < board.size and next_pos[1] <= board[next_pos[0]].size
end
end
def next_moves_match(next_pos,next_char,board)
board[next_pos[0]][next_pos[1]] == next_char
end
@ScorpiusZ
ScorpiusZ / upload.rb
Created February 26, 2016 06:28
upload video from youku to qiniu
require 'qiniu'
require 'csv'
SOURCE_FILENAME = 'topics_data.csv'
TARGET_FILENAME = 'uploaded_data.csv'
REMOTE_PREFIX = 'video/topic'
`mkdir -p video`
module Searchable
extend ActiveSupport::Concern
included do
scope :pg_search, ->(keyword){ where(search_query keyword) }
include ClassMethods
end
module ClassMethods
def search_against params
@ScorpiusZ
ScorpiusZ / nginx.conf
Created January 20, 2016 03:38 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ScorpiusZ
ScorpiusZ / cvimrc
Last active August 29, 2015 14:11
Chrome cVim vimrc
" Settings
set nohud
set nosmoothscroll
set noautofocus " The opposite of autofocus; this setting stops
" sites from focusing on an input box when they load
set typelinkhints
let searchlimit = 30
let scrollstep = 70
let barposition = "bottom"