Skip to content

Instantly share code, notes, and snippets.

View liuyanghejerry's full-sized avatar
Focusing

liuyanghejerry liuyanghejerry

Focusing
View GitHub Profile
@liuyanghejerry
liuyanghejerry / redis.sh
Last active December 16, 2015 09:19
Redis-server management script for CentOS 6.3.
#!/bin/bash
# chkconfig: - 80 12
# description: Controller for redis-server
# processname: redis
# useage: redis {start|stop|restart}
# notice, you need to edit these 4 variables bellow to suit your condition
BIN="/usr/local/redis/bin/redis-server"
@ETiV
ETiV / CentOS-Install-gitlab_ci.sh
Last active March 11, 2021 15:28
Install gitlab-ci on CentOS. I've installed on CentOS 6.4 64bit.
#!/bin/sh
rpm -Uih https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
curl -L https://get.rvm.io | bash -s stable
rvm install 2.0.0
rvm use 2.0.0@global --default
# for chinese user, if you have a wonderful speed ignore this part
# to have a faster download speed
# switch gem source to ruby.taobao.org
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active April 30, 2024 04:42
A badass list of frontend development resources I collected over time.
@roxlu
roxlu / X264Encoder.cpp
Created June 26, 2013 21:01
X264 encoder example
#include <roxlu/core/Log.h>
#include <roxlu/core/Utils.h>
#include <video/X264Encoder.h>
X264Encoder::X264Encoder()
:in_width(0)
,in_height(0)
,in_pixel_format(AV_PIX_FMT_NONE)
,out_width(0)
,out_height(0)
@garethrees
garethrees / plot.p
Last active January 14, 2024 23:21
Graphing apache benchmark results with gnuplot
# Output to a jpeg file
set terminal jpeg size 1280,720
# Set the aspect ratio of the graph
set size 1, 1
# The file to write to
set output "timeseries.jpg"
# The graph title
@Myuzu
Myuzu / secure_random.ex
Last active August 7, 2022 20:09
Elixir ruby-like SecureRandom
# UPD from 2018:
# This gist was written for pre-1.0 version of Elixir and won't work on post-1.0 versions.
# You probably consider using something else!
defmodule SecureRandom do
@moduledoc """
Ruby-like SecureRandom module.
## Examples
@Rob--W
Rob--W / dl-chrome.sh
Created January 23, 2014 12:03
Download a particular version of Google Chrome from Old Apps
#!/bin/sh
# @author Rob Wu <gwnRob@gmail.com> (https://robwu.nl)
version=$1
if [[ "${version}" != *"."* ]] ; then
echo "Repeat the command with an exact version:"
suffix="[0-9.]*"
# Version not specified in $1
[ -z $version ] && suffix="[0-9][0-9.]+"
curl -s http://www.oldapps.com/google_chrome.php | grep -oP "google_chrome.php\?old_chrome=[0-9]+\">[A-Za-z ]+\K${version}${suffix}( [A-Za-z()]+)?" -m 10
elif [ -e "${version}_chrome_installer.exe" ] ; then
@smpallen99
smpallen99 / constants.ex
Created April 5, 2014 18:22
Approach for constants shared between modules in Elixir
defmodule Constants do
@moduledoc """
An alternative to use @constant_name value approach to defined reusable
constants in elixir.
This module offers an approach to define these in a
module that can be shared with other modules. They are implemented with
macros so they can be used in guards and matches
## Examples:
@dorentus
dorentus / shadowsocks-server.service
Last active April 21, 2017 15:59
wget 'https://gist.githubusercontent.com/dorentus/10704239/raw/shadowsocks-server.service' -O /etc/systemd/system/shadowsocks-server.service && systemctl enable shadowsocks-server.service && systemctl start shadowsocks-server.service
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
Type=forking
PIDFile=/run/shadowsocks/server.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/shadowsocks
ExecStartPre=/bin/chown nobody:nogroup /run/shadowsocks
@sergejmueller
sergejmueller / ttf2woff2.md
Last active March 9, 2024 13:37
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2