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 StellarBase.StrKey do | |
@version_types %{<<48>> => :account_id, <<144>> => :seed} | |
def decode_check(expected_version, byte_string) do | |
{:ok, decoded} = Base.decode32("SCEJX4WZXWOMP7XYYMDC5XJB3USSPWSV3AI4LSZYYGIGCXZFG522O4HK") | |
version_byte = String.at(decoded, 0) | |
{:ok, expected_version} = Map.fetch(@version_types, version_byte) | |
payload = String.slice(decoded, 1..-2) | |
expected_check = String.slice(decoded, -2..-1) |
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 Car < Dry::Struct | |
attribute :brand_name, Types::String.optional | |
attribute :model_number, Types::String.optional | |
end |
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
G-NET | |
STA_LUCIA_REALTY | |
TARLAC_CABLE | |
SUBIC_ENERZONE | |
NORKIS | |
CIGNAL | |
CASHSENSE | |
BAYANTEL | |
SORSOGON_WATER | |
UNISTAR |
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 TrackingNumberGenerator | |
include Virtus.model | |
attribute :size, Integer | |
attribute :letters, String, lazy: true, default: :default_letters | |
attribute :numbers, String, lazy: true, default: :default_numbers | |
attribute :code, String, lazy: true, default: :default_code | |
DIGITS = %w(2 3 4 7 9) | |
CONSONANTS = %w(C F G H J K L M N R T V W X Z) |
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
dependencies: | |
pre: | |
- wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" -O UnlimitedJCEPolicyJDK7.zip http://download.oracle.com/otn-pub/java/jce/7/UnlimitedJCEPolicyJDK7.zip | |
- sudo mkdir -p $JAVA_HOME/jre/lib/security | |
- jar xvf UnlimitedJCEPolicyJDK7.zip | |
- sudo cp UnlimitedJCEPolicy/*.jar $JAVA_HOME/jre/lib/security |
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
redis: | |
image: redis:3.0.5 | |
expose: | |
- 6379 | |
volumes: | |
- redis:/var/lib/redis/data | |
web: | |
build: . | |
command: bundle exec rails s -p 3000 -b '0.0.0.0' | |
volumes: |
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
[ | |
{ | |
"name": "Home", | |
"body": "<h1>Welcome to our website!</h1><p>Feel free to browse around. Be <img src=\"http://qc.cisv.ph/assets/images/nice.jpg\"/></p>", | |
"children": [ | |
{ | |
"name": "Child of home page", | |
"body": "<h1>Welcome to our website!</h1><p>Feel free to browse around. Be <img src=\"http://qc.cisv.ph/assets/images/nice.jpg\"/></p>" | |
}, | |
{ |
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
#!/usr/bin/env ruby | |
raise 'I require Ruby 2.0+!' unless RUBY_VERSION[/^2/] | |
def get_production_remote_name | |
ENV["PRODUCTION"] || "production" | |
end | |
def extract_hashes(production_remote_name:) | |
command = [ |
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
" Many stuff from http://www.drbunsen.org/text-triumvirate.html | |
" Visual mode unmap | |
" Bring back the functionality to press shift+e, shift+w, shift+b | |
" while in visual mode to go to the character right before the next | |
" whitespace | |
vunmap E | |
vunmap W | |
vunmap B |
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
I, [2014-12-03T07:37:07.706901 #8446] INFO -- : Started GET "/bitsy/v1/blockchain_notifications?secret=XXXXXX" for 127.0.0.1 at 2014-12-03 07:37:07 -0500 | |
I, [2014-12-03T07:37:08.252596 #8446] INFO -- : Processing by Bitsy::V1::BlockchainNotificationsController#index as HTML | |
I, [2014-12-03T07:37:08.265413 #8446] INFO -- : Parameters: {"secret"=>"XXXXXX"} | |
I, [2014-12-03T07:37:08.891505 #8446] INFO -- : Rendered text template (0.1ms) | |
I, [2014-12-03T07:37:08.896902 #8446] INFO -- : Completed 422 Unprocessable Entity in 629ms (Views: 28.1ms | ActiveRecord: 10.8ms) |