Skip to content

Instantly share code, notes, and snippets.

RedisMaster:
image: bitnami/redis:latest
ports:
- "6380:6379"
environment:
- REDIS_PASSWORD=password
- REDIS_REPLICATION_MODE=master
restart: always
RedisSlave:
image: bitnami/redis:latest
@junxy
junxy / Jenkins Email Template Jelly get git env README.md
Last active January 11, 2017 11:39
Jenkins Email Template Jelly 中获取当前环境变量 build git branch

Jenkins Email Template Jelly 中获取当前环境变量 build git branch

<j:set var="buildenv" value="${build.getEnvironment(listener)}"/>
<j:set var="branch" value="${buildenv.get('GIT_BRANCH')}"/>

${branch}

Environment variables

@junxy
junxy / README.md
Last active November 3, 2015 07:00
brew case install pycharm-edu 2

Installation

brew cask install https://gist.githubusercontent.com/junxy/8d4dbee0e27e72331339/raw/2d2eee22152f5e67b9d621cef4016dddd928e5e8/pycharm-edu.rb
@junxy
junxy / awesome-list.md
Last active December 10, 2015 13:47
awesome - awesome - awesome 重要的说三遍
[Names]
name0=Kepbod
count=1
[Kepbod]
text=f9f8f5
cyan(bold)=12cfc0
text(bold)=f9f8f5
magenta=ae81ff
green=a6e22e
green(bold)=acc267
@junxy
junxy / chrome.sh
Created July 25, 2015 03:13
Fixes chrome user icon gone on mac (version >= 44.0.2403.107)
#!/usr/bin/env bash
open -a "Google Chrome" --args --disable-new-avatar-menu
@junxy
junxy / helpers.php
Created May 18, 2015 12:08
laravel elixir end
if ( ! function_exists('elixir'))
{
/**
* Get the path to a versioned Elixir file.
*
* @param string $file
* @return string
*/
function elixir($file)
{
# defaults for jenkins continuous integration server
JENKINS_ARGS="-jnlpUrl http://test.lnc.jp:8080/computer/wock/slave-agent.jnlp"
# jenkins home location
JENKINS_HOME=/opt/jenkins-slave
# location of the jenkins war file
JENKINS_WAR=$JENKINS_HOME/slave.jar
# pulled in from the init script; makes things easier.
NAME=jenkins
@junxy
junxy / eloquent5sqllog.php
Created April 22, 2015 11:49
eloquent 5 sql log
use Illuminate\Database\Capsule\Manager as DB;
DB::enableQueryLog();
DB::listen(
function ($sql, $bindings, $time) {
// $sql - select * from `ncv_users` where `ncv_users`.`id` = ? limit 1
// $bindings - [5]
// $time(in milliseconds) - 0.38
# Check installed RAM, disable VM if 8Gb or more.
mem_inst=`/usr/sbin/sysctl -n hw.memsize`
if [ "$mem_inst" -ge "8589934592" ]; then
echo "8Gb+ Memory installed."
if [ "$action" == "unload" ]; then
sudo nvram boot-args="vm_compressor=2"
sudo pmset -a hibernatemode 0
echo "vm.compressor_mode set to 2"