Skip to content

Instantly share code, notes, and snippets.

@gudata
gudata / simple_form.rb
Created November 7, 2016 17:23
simple form initialization for http://materializecss.com/
# Use this setup block to configure all options available in SimpleForm.
# https://github.com/patricklindsay/simple_form-materialize/blob/master/lib/generators/simple_form/materialize/templates/config/initializers/simple_form_materialize.rb
# contribute here: https://github.com/mkhairi/materialize-sass/issues/16
SimpleForm.setup do |config|
config.wrappers :default, class: :input,
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
## Extensions enabled by default
# Any of these extensions can be disabled for a
# given input by passing: `f.input EXTENSION_NAME => false`.
@necojackarc
necojackarc / active_job_retry_controlable.rb
Last active June 30, 2021 13:20
To enable ActiveJob to control retry
module ActiveJobRetryControlable
extend ActiveSupport::Concern
DEFAULT_RETRY_LIMIT = 5
attr_reader :attempt_number
module ClassMethods
def retry_limit(retry_limit)
@retry_limit = retry_limit
@sue445
sue445 / README.md
Last active April 22, 2020 10:56
俺のitamaeの実行方法

roleとnodeを設定しておけばいい感じにrake taskを生成します

前提

下記のようなディレクトリ構成を想定しています

  • roles/
    • <role名>.rb
  • nodes/
    • <node名>.yml
  • spec/
@rjmacarthy
rjmacarthy / bitcoind-ubuntu-install
Last active July 22, 2024 03:10
Install Bitcoind Ubuntu
** Add repository and install bitcoind **
sudo apt-get install build-essential
sudo apt-get install libtool autotools-dev autoconf
sudo apt-get install libssl-dev
sudo apt-get install libboost-all-dev
sudo add-apt-repository ppa:luke-jr/bitcoincore
sudo apt-get update
sudo apt-get install bitcoind
mkdir ~/.bitcoin/ && cd ~/.bitcoin/
@ostinelli
ostinelli / ecdsa_example.rb
Last active April 14, 2024 17:32
ECDSA usage from Ruby.
require 'openssl'
require 'base64'
# ===== \/ sign =====
# generate keys
key = OpenSSL::PKey::EC.new("secp256k1")
key.generate_key
public_key = key.public_key
public_key_hex = public_key.to_bn.to_s(16).downcase # public key in hex format
@hashrock
hashrock / vuejs.md
Last active October 5, 2023 23:42
Vue.js資料まとめ(古いので注意)

#まず見るべき

以下のURLは、常に更新されているコンテンツです。

@brossi
brossi / add-new-crypto-to-peatio.md
Last active February 10, 2023 00:08
Adding A New Cryptocurrency to Peatio

State: Draft
Based on the Peatio Stable branch


Coin Daemon

To the coin daemon's {coin}.conf file, include the -walletnotify command:

# Notify when receiving coins
@hidakatsuya
hidakatsuya / README.md
Last active January 17, 2017 07:58
Barby で作ったバーコードのサイズを調整する方法

Barby で作ったバーコードのサイズを調整するサンプルコード

動作確認環境

  • Mac OSX 10.8
  • Ruby 2.0.0-p195
  • ThinReports 0.7.6
  • barby 0.5.1
  • chunky_png 1.2.8
import sublime, sublime_plugin
import os
class AutoSwitchViewTabSizeCommand(sublime_plugin.EventListener):
""" Auto switch tab_size with syntax"""
# def on_activated(self, view):
def on_load(self, view):
syntax = view.settings().get('syntax')
@takashi
takashi / sublime-keymap
Created January 16, 2013 12:42
sublime-keybinding
[
// how to move in the filer with hjkl
{ "keys": ["j"], "command": "move", "args": {"by": "lines", "forward": true}, "context":
[ {"key": "control", "operand": "sidebar_tree"} ]
},
{ "keys": ["k"], "command": "move", "args": {"by": "lines", "forward": false}, "context":
[ {"key": "control", "operand": "sidebar_tree"} ]
},
{ "keys": ["l"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[ {"key": "control", "operand": "sidebar_tree"} ]