Skip to content

Instantly share code, notes, and snippets.

View eonezhang's full-sized avatar

eonezhang eonezhang

  • hnair.com
  • ChengDu
View GitHub Profile
@eonezhang
eonezhang / build.xml
Created September 10, 2016 02:50 — forked from millermedeiros/build.xml
RequireJS optimizer Ant task
<?xml version="1.0" encoding="utf-8"?>
<project name="sample-require-js" default="" basedir=".">
<!-- properties -->
<property name="r.js" value="_build/rjs/r.js" />
<property name="closure.jar" value="_build/closure/compiler.jar" />
<property name="rhino.jar" value="_build/rhino/js.jar" />
<property name="js.build" value="_build/js.build.js" />
<property name="css.build" value="_build/css.build.js" />
@eonezhang
eonezhang / idea
Created May 2, 2018 08:42 — forked from chrisdarroch/idea
Open a project in IntelliJ IDEA from your command line!
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
wd=`ls -1d "$1" | head -n1`
@eonezhang
eonezhang / Cargo.toml
Created October 20, 2018 04:42 — forked from nicolov/Cargo.toml
Rust API with Mysql
[package]
name = "api_example"
version = "0.1.0"
authors = ["nicolov"]
[dependencies]
iron = "*"
router = "*"
mysql = "*"
r2d2 = "*"
@eonezhang
eonezhang / yaml
Created March 27, 2021 11:19
ansible获取操作系统版本
# https://www.ipcpu.com/2016/01/ansible-setup-when/
# 通过使用 ansible 的 setup 模块,可以将操作系统的版本变量获取并存储在 ansible 内置的变量中, 可以在脚本中直接引用.
- hosts: webserver
vars:
logserver: 10.127.2.170
gather_facts: True
tasks:
- name: add conf to config files to CentOS6
lineinfile: dest=/etc/rsyslog.conf line="*.* @{{ logserver }}"
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == "6"