Skip to content

Instantly share code, notes, and snippets.

@smt116
smt116 / redis-server
Last active April 29, 2023 17:44 — forked from sumodirjo/redis-server
redis-server init script
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
#!/usr/bin/env ruby
require 'time'
require 'gnuplot'
require 'launchy'
require 'tempfile'
require 'fileutils'
ARGV.sort!.reverse!
raise ArgumentError.new("USAGE: #{__FILE__} input.tsv [--without-items] [--without-capacity] [--save]") if ARGV.empty?
@smt116
smt116 / setup_admin_panel_on_workflow.sh
Created January 10, 2017 08:54
The script that setup Admin Panel application on Workflow (Deis v2)
#!/usr/bin/env sh
green() { echo "$(tput setaf 2)$*$(tput setaf 9)"; }
yellow() { echo "$(tput setaf 3)$*$(tput setaf 9)"; }
wait_for_pods () {
green "Waiting for pods..."
STARTED_AT=$(date +%s)
while true; do
should_wait=false
@smt116
smt116 / GIF-Screencast-OSX.md
Created February 29, 2016 20:25 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

function string.random(length)
if length < 1 then return nil end
local str = ""
for i = 1, length do
n = math.random(32, 122)
if (n > 32 and n < 48) or (n > 57 and n < 65) or (n > 90 and n < 97) then n = math.random(97, 122) end
str = str .. string.char(n)
end
function string.random(length)
if length < 1 then return nil end
local str = ""
for i = 1, length do
n = math.random(32, 122)
if (n > 32 and n < 48) or (n > 57 and n < 65) or (n > 90 and n < 97) then n = math.random(97, 122) end
str = str .. string.char(n)
end
@smt116
smt116 / Gemfile
Last active August 29, 2015 14:08 — forked from sabcio/Gemfile
source :rubygems
gem 'rack'
gem 'rake'
gem 'thin', group: :production

User

Create user

Request: POST https://localhost/api/v1/user

Require parameters:

  • email: unique e-mail address
  • password: user password