This file contains hidden or 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
| version: "2" | |
| volumes: | |
| parse_server_vol: | |
| driver: "local" | |
| parse_server_cloud_vol: | |
| driver: "local" | |
| mongo_db_vol: | |
| driver: "local" |
This file contains hidden or 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 google_font_download( font, style, subset, file_name ) | |
| def str_difference( a, b ) | |
| a = a.to_s.downcase.split( '_' ).join( '' ) | |
| b = b.to_s.downcase.split( '_' ).join( '' ) | |
| longer = [ a.size, b.size ].max | |
| same = a | |
| .each_char | |
| .zip( b.each_char ) | |
| .select { | a, b | a == b } | |
| .size |
This file contains hidden or 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
| ### quick solution - no recursive behaviour. | |
| def get_allow_list( params ) | |
| lists = {} | |
| lists[:allow] = [] | |
| lists[:block] = [] | |
| params.keys.each do | lvl1 | | |
| if params[ lvl1 ].class.to_s.eql? 'Hash' | |
| params[ lvl1 ].keys.each do | lvl2 | |
This file contains hidden or 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 markdown_options_tables( lists, params ) | |
| def pick_values( pick, params ) | |
| keys = pick | |
| .to_s | |
| .split( '__' ) | |
| .map{ | a | a.to_sym } | |
| result = nil | |
| case( keys.length) | |
| when 1 | |
| result = params[ keys[ 0 ] ] |
This file contains hidden or 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 options_update( options, obj, validation ) | |
| def str_difference( a, b ) | |
| a = a.to_s.downcase.split( '_' ).join( '' ) | |
| b = b.to_s.downcase.split( '_' ).join( '' ) | |
| longer = [ a.size, b.size ].max | |
| same = a | |
| .each_char | |
| .zip( b.each_char ) | |
| .select { | a, b | a == b } | |
| .size |
This file contains hidden or 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 create_example() | |
| test = [] | |
| keys = [ :frodo, :golom, :gandalf, :kimly, :legolas, :sam ] | |
| groups = keys.inject( {} ) do | hash, key | | |
| hash[ key ] = {} | |
| key == :frodo ? n = 100 : n = rand( 0..13 ) | |
| hash[ key ] = n.times.map { | a | '' } | |
| hash | |
| end |
This file contains hidden or 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 version_bump( version ) | |
| nums = version | |
| .split( '.' ) | |
| .map { | n | n.to_i } | |
| if nums[ 2 ] == 9 and nums[ 1 ] == 9 | |
| nums[ 0 ] = nums[ 0 ] + 1 | |
| nums[ 1 ] = 0 | |
| nums[ 2 ] = 0 | |
| elsif nums[ 2 ] == 9 |
This file contains hidden or 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 helper( obj, index ) | |
| puts obj[:projects][ index ] | |
| current = obj[:projects][ index ] | |
| puts '> INPUT' | |
| current.each do | k, v | | |
| space = ( 15 - k.length ).times.map { | a | ' ' }.join( '' ) | |
| puts( " #{k}:#{space}#{v}" ) | |
| end | |
| puts |
This file contains hidden or 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
| =begin | |
| Filename: .env (plain text) | |
| ---------- | |
| TEST_ENV=my secret | |
| TESTING=123 | |
| =end | |
| def env_prepare( prefix ) | |
| # load .env file | |
| tmp = File |
This file contains hidden or 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
| function compare( search, list ) { | |
| function name( str ) { | |
| let search = str | |
| .split( '(' )[ 0 ] | |
| .split( ' ' ) | |
| .slice( -1 )[ 0 ] | |
| return search | |
| } | |
| function str_difference( search, change ) { |
OlderNewer