This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Sensible | |
module Array | |
class ::Array | |
alias_method :select_std, :select | |
def select arg = nil, &cb | |
preselected = case arg | |
# no argument ⇒ standard processing | |
when NilClass then self | |
# strings are matched as is | |
when String then select_std do |e| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export TERM=xterm-256color | |
# Less Colors for Man Pages | |
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking | |
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold | |
export LESS_TERMCAP_me=$'\E[0m' # end mode | |
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode | |
export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box | |
export LESS_TERMCAP_ue=$'\E[0m' # end underline | |
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
RMS=`basename "$0"` | |
RMS_HOME=/home/ubuntu/Apps/rms | |
application_start() { | |
echo -n "Starting RapidMiner Server daemon... " | |
# to satisfy fcuking RMS, run as a user: | |
# sudo -u ubuntu $RMS_HOME/bin/standalone.sh 2>&1 > $RMS_HOME/log/$RMS-$(date +"%m-%d-%y").log & | |
$RMS_HOME/bin/standalone.sh 2>&1 >/var/log/$RMS.log & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> | |
<properties> | |
<entry key="db_url">localhost</entry> | |
<entry key="db_port">3306</entry> | |
<entry key="server_service_id_overwrite">null</entry> | |
<entry key="eula_accepted">true</entry> | |
<entry key="server_port">8080</entry> | |
<entry key="db_password">*******</entry> | |
<entry key="mail_password"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProgressBar | |
RUNNING = %W{👆 👇 👈 👉 👊}.freeze | |
attr_reader :count, :position | |
def initialize caption, count, running = RUNNING | |
@count = count | |
@caption = " #{caption} " | |
@running = running.cycle | |
@position = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on agnoster zsh prompt | |
# vim:ft=zsh ts=2 sw=2 sts=2 | |
# | |
# mudasobwa's Theme - https://gist.github.com/3712874 | |
# A Powerline-inspired theme for ZSH | |
# | |
# # README | |
# | |
# In order for this theme to render correctly, you will need a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IEx.configure colors: [enabled: true] | |
# IEx.configure colors: [eval_result: [:cyan, :bright]] | |
{fortune, 0} = System.cmd "fortune", [] # displays the fortune prompt | |
IO.puts IO.ANSI.red_background() <> IO.ANSI.white() <> "▷ #{fortune}" <> IO.ANSI.reset | |
Application.put_env(:elixir, :ansi_enabled, true) | |
IEx.configure( | |
colors: [ | |
eval_result: [:green, :bright] , | |
eval_error: [[:red, :bright, "\n▶▶▶\n"]], | |
eval_info: [:yellow, :bright ], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark/ips' | |
n = 500000 | |
require 'digest/md5' | |
require 'digest/sha1' | |
require 'digest/sha2' | |
require 'digest/sha3' # https://github.com/phusion/digest-sha3-ruby | |
INPUT = [5, "Hello, world", nil] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Eventory.Helpers.Log do | |
@moduledoc false | |
Enum.each(~w|error info warn debug|a, fn level -> | |
Module.register_attribute(__MODULE__, :level, persist: false) | |
Module.put_attribute(__MODULE__, :level, level) | |
defmacro unquote(Module.get_attribute(__MODULE__, :level))(chardata_or_fun, metadata \\ []) do | |
{{:., [], [ | |
{:__aliases__, [alias: false], [:Logger]}, | |
unquote(Module.get_attribute(__MODULE__, :level))]}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def a1 | |
:normal | |
ensure | |
:ensure | |
end | |
def a2 | |
return :normal | |
ensure | |
return :ensure |
OlderNewer