Skip to content

Instantly share code, notes, and snippets.

View lvjian700's full-sized avatar

Jian Lyu lvjian700

View GitHub Profile
@milk1000cc
milk1000cc / bybit.rb
Created May 7, 2021 13:22
Ruby Bybit API Example
# https://bybit-exchange.github.io/docs/inverse/
# https://github.com/bybit-exchange/api-connectors/blob/master/encryption_example/Encryption.rb
require 'open-uri'
require 'openssl'
require 'json'
require 'bigdecimal'
require 'bigdecimal/util'
API_ENDPOINT = 'https://api.bybit.com'
@oleganza
oleganza / async_swift_proposal.md
Last active May 12, 2023 10:06
Concrete proposal for async semantics in Swift

Async semantics proposal for Swift

Modern Cocoa development involves a lot of asynchronous programming using blocks and NSOperations. A lot of APIs are exposing blocks and they are more natural to write a lot of logic, so we'll only focus on block-based APIs.

Block-based APIs are hard to use when number of operations grows and dependencies between them become more complicated. In this paper I introduce asynchronous semantics and Promise type to Swift language (borrowing ideas from design of throw-try-catch and optionals). Functions can opt-in to become async, programmer can compose complex logic involving asynchronous operations while compiler produces necessary closures to implement that logic. This proposal does not propose new runtime model, nor "actors" or "coroutines".

Table of contents

<form action="http://up.qiniu.com/" enctype="multipart/form-data" class="dropzone dz-clickable" id="upload-form">
<div class="dz-default dz-message">
<span>Drop files here to upload</span>
</div>
<input name="token" type="hidden" value="<%= @token %>">
<input name="x:uid" type="hidden" value="<%= current_user.id %>">
<div class="fallback">
<input name="file" type="file" multiple />
@dongyuwei
dongyuwei / rea.yml
Last active December 29, 2015 14:59
tmux and teamocil config
windows:
- name: "start-rea-services"
root: "~/code"
layout: tiled
panes:
- cmd: "cd solr-search/ && git pull --rebase && bundle exec rake dev:run"
- cmd: "cd search-api/ && git pull --rebase && ./gradlew run"
- cmd: "cd location-service/ && git pull --rebase && ./gradlew run"
- cmd: "cd china-jobs/ && git pull --rebase && sh start.sh"
- cmd: "redis-server /usr/local/etc/redis.conf"
@yorzi
yorzi / Gemfile
Created November 18, 2013 12:48
A group of basic reusable settings/configs for a new rails project.
source 'http://rubygems.org'
# source 'http://ruby.taobao.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.1'
#
# Use postgresql as the database for Active Record
gem 'pg'
# for heroku deployment
@m1entus
m1entus / build-ffmpeg.sh
Last active June 22, 2024 04:06
Installing ffmpeg ios libraries armv7, armv7s, i386
#!/bin/bash
###########################################################################
# Choose your ffmpeg version and your currently-installed iOS SDK version:
#
VERSION="2.0.2"
SDKVERSION="7.0"
ARCHS="armv7 armv7s i386"
#
#
@schickling
schickling / Rakefile
Last active September 3, 2024 02:52
Activerecord without Rails
require "active_record"
namespace :db do
db_config = YAML::load(File.open('config/database.yml'))
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'})
desc "Create the database"
task :create do
ActiveRecord::Base.establish_connection(db_config_admin)
@cloudsben
cloudsben / md-menu.html
Last active June 14, 2023 07:46
markdown menu
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.2/styles/googlecode.min.css">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://yandex.st/highlightjs/6.2/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script type="text/javascript">
$(document).ready(function(){
$("h2,h3,h4,h5,h6").each(function(i,item){
var tag = $(item).get(0).localName;
@kates
kates / search_and_replace.sh
Last active August 31, 2019 05:22
bulk search and replace with the silver searcher, awk, sed and xargs
ag "sometext" --nogroup | awk '{print substr($1,1,index($1,":")-1);}' | xargs -I {} sed -i .bak -e 's/sometext/anothertext/g' {}
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active September 21, 2024 08:58
A badass list of frontend development resources I collected over time.