Skip to content

Instantly share code, notes, and snippets.

View molizz's full-sized avatar
🎯
Focusing

moli molizz

🎯
Focusing
View GitHub Profile
@molizz
molizz / golang-scheme.icls
Last active August 9, 2018 07:51
golang scheme for goland
<scheme name="VS by Darcula " version="142" parent_scheme="Darcula">
<metaInfo>
<property name="created">2018-08-09T15:49:08</property>
<property name="ide">GoLand</property>
<property name="ideVersion">2018.1.5.0.0</property>
<property name="modified">2018-08-09T15:49:26</property>
<property name="originalScheme">VS by Darcula</property>
</metaInfo>
<attributes>
<option name="GO_BUILTIN_VARIABLE">
@molizz
molizz / gist:1e99ea1edcc6c4b086342ea577bbf508
Created February 13, 2017 10:20 — forked from zhangyuan/gist:5932220
使用 CarrierWave 和 MiniMagick 合成多张图片、写文字

合成多张图片

以下只适合 v3.5.0 即以前的版本。v3.6.0 以后,对选项增加了 shellescape 减少了命令行注入的风险。

ImageMagick 的 composite 命令可以合成图片,但是一次只能合成两张。如果需要合成多张图片,得用 convert 命令和 -composite 选项。MiniMagick 的push方法,可添加选项和参数(就像在命令行操作一样)。下是一个合成多张图片的 CarrierWave 的 process 示例。

  def composite_images
    manipulate! do |img|
      img.combine_options(:convert) do |c|
@molizz
molizz / kill_php.rb
Last active February 25, 2017 17:55
# 自动关闭状态为闲置(s)的php进程
#!/usr/bin/env ruby
# 自动关闭状态为闲置(s)的php进程
require 'time'
def php_processes
ps = `ps aux|grep -e '/opt/cpanel/ea-php'`
process = Struct.new(:pid, :created_at, :status) do
def kill()
`kill -6 #{pid}`
@molizz
molizz / cloudSettings
Last active June 22, 2020 02:59
VSCode's Settings - Syncing
{"lastUpload":"2020-06-22T02:59:20.994Z","extensionVersion":"v3.4.3"}
@keyframes takeoff {
0% {
bottom: -10%;
left: 0px;
-webkit-transform: scale(0.6) rotate(-90deg);
}
50% {
bottom: 50%;
left: 50%;
-webkit-transform: scale(0.6) translate(-50%, -50%)