Skip to content

Instantly share code, notes, and snippets.

View xiangzhuyuan's full-sized avatar
🤗

Mathew P. Jones xiangzhuyuan

🤗
View GitHub Profile

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

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

by: 罗永浩

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

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

@xiangzhuyuan
xiangzhuyuan / gist:5133140
Created March 11, 2013 09:51
about date
package com.demo;
import java.util.Calendar;
import java.util.Date;
public class DemoDateUtil {
//static DateUtil du = new DateUtil();
/**
* @param args
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>
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
# -- coding: utf-8
require "pp"
require "rubygems"
require 'sinatra'
require 'sinatra/base'
module Sinatra
module Helpers
class Stream
@claylevering
claylevering / bitly.sh
Created February 15, 2012 02:20
Bit.ly Alfred App Extension
# modified API url to align with changes to bit.ly requirements - @claylevering
# find the .alfredextension here: http://cl.ly/EEUK
declare -r API='https://api-ssl.bitly.com/v3/shorten'
declare -r LOGIN='yourlogin'
declare -r API_KEY='yourapi'
# add http scheme to URL if none is provided
longURL=$(printf "{query}" | sed -E -e 's|^.|http://&|' -e 's|^http://([a-zA-Z\-\.\+]+://)|\1|')
@crazy4groovy
crazy4groovy / dirHtmlPageRenderToPng.js
Created July 22, 2012 15:57
PhantomJS script to loop through local directory and render HTML pages as PNG
/* tested on PhantomJS 1.6 */
var page = require('webpage').create(), loadInProgress = false, fs = require('fs');
var htmlFiles = new Array();
// console.log(fs.workingDirectory);
// console.log(phantom.args[0]);
var curdir = phantom.args[0] || fs.workingDirectory;
var curdirList = fs.list(curdir);
@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:

@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
@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