Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# -*- coding: utf-8
from __future__ import (print_function, )
import six
from six import ensure_binary, text_type, ensure_text
import json
__all__ = ['json_str_or_bytes_repr_as_safe_text']
#!/bin/sh
# Run this script on Centos 7 to quickly install python 3 and relavent
# packages to run python 3 applications, including pip, virtualenv.
# Will use a local yum repository at `172.16.8.113` to speed up.
if ! grep -q "CentOS Linux release 7" /etc/redhat-release; then
echo Not centos 7, will soon abort
exit 1
fi
#!/usr/bin/env bash
set -e
####
# Author zhongwm 2019-4-20
# This script uses cairosvg (python 3 package) to make iOS app icon from SVG file.
# Prerequisites install: brew install cairo && pip3 install cairosvg;
####
INPUT=$1
INPUT_BASENAME=`basename $INPUT`
INPUT_BASENAME_NOEXT=${INPUT%.*}
import java.math.{MathContext, RoundingMode}
import scala.util.Random
/**
* <p></p>
* User: zwm<br/>
* Date: 6/5/15<br/>
* Time: 12:24
*/
object Racing extends App {
@zhongwm
zhongwm / ConcurrentCase.scala
Created November 6, 2014 09:34
gist for synchronization
package icej1
import Ice.Current
import apps.Item
import scala.collection.mutable
import scala.collection.JavaConverters._
/**
*
@zhongwm
zhongwm / gist:6504401
Created September 10, 2013 02:47
java opts for jmx connection, visualvm connection.
JAVA_OPTS="-Dcom.sun.management.jmxremote.port=9777 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false "