Skip to content

Instantly share code, notes, and snippets.

FROM ruby
RUN apt-get -y update && apt-get -y install libicu-dev cmake ruby-bundler && rm -rf /var/lib/apt/lists/*
COPY . /opt/gollum
WORKDIR /opt/gollum
RUN bundle install --path vendor/bundle
ENTRYPOINT ["gollum", "--adapter", "rugged", "--port", "80", "--bare", "/srv/wiki"]
EXPOSE 80
@sunnyone
sunnyone / gist:50e57c6e9f702ae44857bdd061795173
Created February 1, 2018 08:07
Parameters json to aws cloudformation json
jq '.Parameters | to_entries | map("\(.key)=\(.value)") | join(" ")' /tmp/test.json
extern crate subprocess;
use subprocess::Exec;
use std::io::BufReader;
use std::io::{BufRead};
use std::error::Error;
fn execute() -> std::result::Result<(), Box<Error>> {
let exec = Exec::cmd("/tmp/hoge.sh")
.stderr(subprocess::Redirection::Merge);
@sunnyone
sunnyone / wait-cf-deployed.sh
Last active January 18, 2018 08:49
Wait CloudFront deployed
#!/bin/sh
if [ -z "$1" ] ; then
echo usage: $0 id
exit 1
fi
CLOUDFRONT_ID=$1
while true; do
@sunnyone
sunnyone / partialeq.rs
Created December 15, 2017 14:51
PartialEq generated
// #[derive(PartialEq)]
// pub enum Option2<T> {
// None,
// Some(T),
// }
// $ rustc option.rs -Z unstable-options --pretty=expanded
#![feature(prelude_import)]
#![no_std]
#[prelude_import]
use std::prelude::v1::*;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gimpfu import *
def plugin_main(image, layer):
image.disable_undo()
image.resize(image.width / 2, image.height / 2, 0, 0)
layer.scale(image.width, image.height, 0, 0)
image.enable_undo()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gimpfu import *
def plugin_main(image, layer, image_path):
# image.disable_undo()
layer = pdb.gimp_file_load_layer(image, image_path)
layer.opacity = 50.0
layer.mode = SUBTRACT_MODE
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gimpfu import *
def plugin_main(image_arg, layer_arg, image_path):
image = pdb.gimp_file_load(image_path, "")
image.resize(image.width / 2, image.height / 2, 0, 0)
layer = image.layers[0]
layer.scale(image.width, image.height, 0, 0)
@sunnyone
sunnyone / mydns.lua
Last active September 19, 2018 16:04 — forked from shiwork/mydns.lua
YAMAHA RTXシリーズでDDNSをLuaで更新通知するスクリプト
------------------------------------
-- Config
------------------------------------
-- MyDNS ID
mid="MyDNSID"
-- MyDNS Password
pwd="MyDNSPASSWD"
<button :class="'btn btn-' + size"></button>