Skip to content

Instantly share code, notes, and snippets.

View xiangzhuyuan's full-sized avatar
🤗

Mathew P. Jones xiangzhuyuan

🤗
View GitHub Profile
anonymous
anonymous / index.html
Created September 20, 2016 06:17
Redux basic example // source http://jsbin.com/kegofu
<!DOCTYPE html>
<html>
<head>
<title>Redux basic example</title>
<script src="https://npmcdn.com/redux@latest/dist/redux.min.js"></script>
</head>
<body>
<div>
<p>
Clicked: <span id="value">0</span> times
anonymous
anonymous / index.html
Created September 20, 2016 05:23
JS Bin // source http://jsbin.com/lekutu
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://unpkg.com/redux@3.6.0/dist/redux.min.js"></script>
@yesnik
yesnik / response_example.rb
Created October 21, 2015 12:01
Ruby on Rails request.env variable content
# This is the content of variable request.env
# We get this content in controller:
# class BlogsController < ApplicationController
# def index
# render plain: "Response: #{ YAML::dump(request.env) }"
# end
# end
@edvinasbartkus
edvinasbartkus / gist:0e99ea8305a20737f562
Last active May 20, 2022 11:08
Ruby puma.gem install on El Capitan / Mac Sierra
gem install puma -- --with-cppflags=-I/usr/local/opt/openssl/include --with-ldflags=-L/usr/local/opt/openssl/lib

“即使你把你最好的都给了这个世界,可能还是远远不够... 无论如何,你还是要把你最好的给这个世界"

created at: 2015年2月10日 16:45

by: 罗永浩

界面的文章“隐形战友” http://weibo.com/5182171545/C2r5UzLPB 是这些年来罕见的一篇打动我的新闻报道,并不是因为我们有幸成为了 OpenSSL 的“战友”和这篇文章的最佳配角,而是因为这篇文章写得有血有肉、有理有据,并且带有分寸感良好的温度。在此之前,虽然我们已经捐助了 OpenSSL,并且也知道 OpenSSL 牛x,但不知道他们这么牛x。

这篇文章在网上发表后,我的老冤家、网红程序员霍炬很快写了一篇题为“到底谁才是真正的隐形战友——开源软件和 OpenSSL 的真实故事”的文章 http://weibo.com/5182171545/C33492lGs

@ouyangzhiping
ouyangzhiping / docker-gitlab.md
Last active July 20, 2021 08:14
docker-gitlab部署

docker用来隔离应用还是很方便的,一来本身的操作较为简单,二来资源占用也比虚拟机要小得多,三来也较为安全,因为像数据库这样的应用不会再全局暴露端口,同时应用间的通信通过加密和端口转发,更加安全。

Gitlab是目前比较流行的开源类Github代码管理平台。Gitlab使用Rails开发,使用PostgreSQL或MySQL数据库,Redis做缓存。一般自己搭建私有代码仓库,Gitlab通常是首选。这里简单介绍一下dockerized Gitlab。

Gitlab的docker镜像早已有人做好了,并且维护相当不错。大家可以前往其GitHub仓库了解该镜像的情况。官方repo的readme中已经有详细的安装配置方案,这里我简单的梳理一下部署流程。

安装Docker

这里以Ubuntu 14.04发行版为例,在bash中输入一下命令安装最新的docker:

@sebmarkbage
sebmarkbage / react-terminology.md
Last active January 9, 2023 22:47
React (Virtual) DOM Terminology
  • Dynamic Dispatch
  • Dynamic Method
  • Ghost Methods
  • Dynamic Proxies
  • Blank Slate
  • Kernel Method
  • Flattening the Scope (aka Nested Lexical Scopes)
  • Context Probe
  • Class Eval (not really a 'spell' more just a demonstration of its usage)
  • Class Macros

测试平台:DigitalOcean VPS ubuntu14.04 x64, strongswan5.2.2

运行以下命令请使用root权限

一:安装strongswan

由于ubuntu软件仓库中strongswan版本较低,因此从官网源码编译安装

apt-get install build-essential     #编译环境
aptitude install libgmp10 libgmp3-dev libssl-dev pkg-config libpcsclite-dev libpam0g-dev     #编译所需要的软件
@lanrion
lanrion / gist:9479631
Last active December 5, 2023 08:20
浅析微信信息信息接收与信息回复

微信的信息接收与回复,两者是独立的。

信息接收

共同点在于:都有 ToUserName,FromUserName,CreateTime,MsgType, 这四个字段。

在信息接收方面,分为“普通消息”、“事件推送”,“语音识别结果(微信用户发送语音,微信服务器翻译成文本,只不过比语音消息多一个识别结果字段:Recognition)”。

  • 文本消息(通过“Content”关键字来获取文本内容,这点比较重要,也是使用比较多的场合)
  • 图片消息