Skip to content

Instantly share code, notes, and snippets.

View Edison-Hsu's full-sized avatar
🎯
Focusing

Edison.Hsu Edison-Hsu

🎯
Focusing
View GitHub Profile
@tesths
tesths / rvm.sh
Last active November 28, 2019 08:33
rvm
#fork from https://github.com/huacnlee/init.d
# export LC_ALL=zh_CN.UTF-8
# export LANGUAGE=zh_CN.UTF-8
# sudo locale-gen zh_CN.UTF-8
sudo apt-get -y install update
sudo apt-get -y install curl
echo "Install RVM"
echo "---------------------------------------------------------------------------"
@daliborgogic
daliborgogic / delay.js
Created December 16, 2016 15:26
Node.js Async/Await delay
'use strict'
const timeout = ms => new Promise(res => setTimeout(res, ms))
function convinceMe (convince) {
let unixTime = Math.round(+new Date() / 1000)
console.log(`Delay ${convince} at ${unixTime}`)
}
async function delay () {
@JohnWong
JohnWong / Dev-RSS
Created December 5, 2015 14:18
我的RSS订阅 OMPL格式
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>晓哲 subscriptions in feedly Cloud</title>
</head>
<body>
<outline text="前端" title="前端">
<outline type="rss" text="掌心" title="掌心" xmlUrl="http://www.zhanxin.info/feed.xml" htmlUrl="http://www.zhanxin.info/feed.xml"/>
<outline type="rss" text="Blog of Wenli Zhang" title="Blog of Wenli Zhang" xmlUrl="http://zhangwenli.com/blog/feed.xml" htmlUrl="http://zhangwenli.com/blog"/>
@austinzheng
austinzheng / CustomTextInputView.swift
Last active January 20, 2022 15:14
Simple UIKeyInput example
import UIKit
/// A very simple example view that can accept keyboard input and add or delete text from an enclosed label.
class CustomTextInputView : UIControl, UIKeyInput {
var label : UILabel?
override func canBecomeFirstResponder() -> Bool {
return true
}
@jandudulski
jandudulski / auth.rb
Last active September 14, 2022 12:09
CSRF on Grape
# based on http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html
module Auth
extend ActiveSupport::Concern
included do
helpers do
def session
env['rack.session']
end
@staltz
staltz / introrx.md
Last active October 26, 2025 03:06
The introduction to Reactive Programming you've been missing
@piotrga
piotrga / Json.scala
Last active April 4, 2018 07:42
The simplest dynamically typed json parsing with Dynamic in Scala 2.10
import util.parsing.json.JSON
import io.Source
import scala.language.dynamics
object Example extends App{
val json = """{
"name" : "Adam Slodowy",
"active": "true",
"roles" : [ "teacher", "admin" ],
@huacnlee
huacnlee / _form.html.erb
Created August 21, 2012 10:55
UpYun 表单上传验证信息 helper 方法,用于生成 input tag
<form action="http://v0.api.upyun.com/rbtest/" method="post" enctype="multipart/form-data">
<%= upyun_form_input_tag(:return_url => new_post_path) %>
<input type="file" name="file" />
<button type="submit">上传图片</button>
</form>