freespeech 1.0.88 → 1.0.94

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/README +2 -0
  3. data/README.md +99 -65
  4. data/VERSION_NUMBER +1 -1
  5. data/bin/autocorrect +312 -0
  6. data/bin/black +0 -0
  7. data/bin/black_bold +0 -0
  8. data/bin/black_bold_underline +0 -0
  9. data/bin/black_underline +0 -0
  10. data/bin/blue +0 -0
  11. data/bin/blue_bold +0 -0
  12. data/bin/blue_bold_underline +0 -0
  13. data/bin/blue_underline +0 -0
  14. data/bin/bold +0 -0
  15. data/bin/ctit +44 -0
  16. data/bin/cyan +0 -0
  17. data/bin/cyan_bold +0 -0
  18. data/bin/cyan_bold_underline +0 -0
  19. data/bin/cyan_underline +0 -0
  20. data/bin/green +0 -0
  21. data/bin/green_bold +0 -0
  22. data/bin/green_bold_underline +0 -0
  23. data/bin/green_underline +0 -0
  24. data/bin/magenta +0 -0
  25. data/bin/magenta_bold +0 -0
  26. data/bin/magenta_bold_underline +0 -0
  27. data/bin/magenta_underline +0 -0
  28. data/bin/red +0 -0
  29. data/bin/red_bold +0 -0
  30. data/bin/red_bold_underline +0 -0
  31. data/bin/red_underline +0 -0
  32. data/bin/underline +0 -0
  33. data/bin/white +0 -0
  34. data/bin/white_bold +0 -0
  35. data/bin/white_bold_underline +0 -0
  36. data/bin/white_underline +0 -0
  37. data/bin/yellow +0 -0
  38. data/bin/yellow_bold +0 -0
  39. data/bin/yellow_bold_underline +0 -0
  40. data/bin/yellow_underline +0 -0
  41. data/documentation/autocorrect +3 -0
  42. data/documentation/ctit +18 -0
  43. data/documentation/email +2 -2
  44. data/documentation/left_right.exe +4 -3
  45. data/documentation/page +8 -1
  46. data/gem_data/README +2 -0
  47. data/gem_data/VERSION_NUMBER +1 -1
  48. data/gem_data/push_snap +30 -0
  49. data/images/STORE.png +0 -0
  50. data/images/STORE2.png +0 -0
  51. data/images/Store.png +0 -0
  52. data/index.html +108 -94
  53. data/non_compiled_programs/autocorrect +312 -0
  54. data/non_compiled_programs/ctit +44 -0
  55. data/other/beautify_html_in_heredocs +8 -0
  56. data/{cleanup → other/cleanup} +1 -0
  57. data/other/communicate +88 -0
  58. data/other/experimental_code/ABOUT_S +1 -10
  59. data/other/experimental_code/a/six +0 -0
  60. data/other/experimental_code/odi +4 -10
  61. data/other/experimental_code/orig +11 -20
  62. data/other/experimental_code/pr.rb +1 -1
  63. data/push_snap +30 -0
  64. data/src/color_tools/black +0 -0
  65. data/src/color_tools/black.c +9 -12
  66. data/src/color_tools/black_bold +0 -0
  67. data/src/color_tools/black_bold.c +9 -12
  68. data/src/color_tools/black_bold_underline +0 -0
  69. data/src/color_tools/black_bold_underline.c +9 -12
  70. data/src/color_tools/black_underline +0 -0
  71. data/src/color_tools/black_underline.c +9 -12
  72. data/src/color_tools/blue +0 -0
  73. data/src/color_tools/blue.c +9 -12
  74. data/src/color_tools/blue_bold +0 -0
  75. data/src/color_tools/blue_bold.c +9 -12
  76. data/src/color_tools/blue_bold_underline +0 -0
  77. data/src/color_tools/blue_bold_underline.c +9 -12
  78. data/src/color_tools/blue_underline +0 -0
  79. data/src/color_tools/blue_underline.c +9 -12
  80. data/src/color_tools/bold +0 -0
  81. data/src/color_tools/bold.c +9 -12
  82. data/src/color_tools/colors.rb +9 -12
  83. data/src/color_tools/cyan +0 -0
  84. data/src/color_tools/cyan.c +9 -12
  85. data/src/color_tools/cyan_bold +0 -0
  86. data/src/color_tools/cyan_bold.c +9 -12
  87. data/src/color_tools/cyan_bold_underline +0 -0
  88. data/src/color_tools/cyan_bold_underline.c +9 -12
  89. data/src/color_tools/cyan_underline +0 -0
  90. data/src/color_tools/cyan_underline.c +9 -12
  91. data/src/color_tools/green +0 -0
  92. data/src/color_tools/green.c +9 -12
  93. data/src/color_tools/green_bold +0 -0
  94. data/src/color_tools/green_bold.c +9 -12
  95. data/src/color_tools/green_bold_underline +0 -0
  96. data/src/color_tools/green_bold_underline.c +9 -12
  97. data/src/color_tools/green_underline +0 -0
  98. data/src/color_tools/green_underline.c +9 -12
  99. data/src/color_tools/magenta +0 -0
  100. data/src/color_tools/magenta.c +9 -12
  101. data/src/color_tools/magenta_bold +0 -0
  102. data/src/color_tools/magenta_bold.c +9 -12
  103. data/src/color_tools/magenta_bold_underline +0 -0
  104. data/src/color_tools/magenta_bold_underline.c +9 -12
  105. data/src/color_tools/magenta_underline +0 -0
  106. data/src/color_tools/magenta_underline.c +9 -12
  107. data/src/color_tools/red +0 -0
  108. data/src/color_tools/red.c +9 -12
  109. data/src/color_tools/red_bold +0 -0
  110. data/src/color_tools/red_bold.c +9 -12
  111. data/src/color_tools/red_bold_underline +0 -0
  112. data/src/color_tools/red_bold_underline.c +9 -12
  113. data/src/color_tools/red_underline +0 -0
  114. data/src/color_tools/red_underline.c +9 -12
  115. data/src/color_tools/underline +0 -0
  116. data/src/color_tools/underline.c +9 -12
  117. data/src/color_tools/white +0 -0
  118. data/src/color_tools/white.c +9 -12
  119. data/src/color_tools/white_bold +0 -0
  120. data/src/color_tools/white_bold.c +9 -12
  121. data/src/color_tools/white_bold_underline +0 -0
  122. data/src/color_tools/white_bold_underline.c +9 -12
  123. data/src/color_tools/white_underline +0 -0
  124. data/src/color_tools/white_underline.c +9 -12
  125. data/src/color_tools/yellow +0 -0
  126. data/src/color_tools/yellow.c +9 -12
  127. data/src/color_tools/yellow_bold +0 -0
  128. data/src/color_tools/yellow_bold.c +9 -12
  129. data/src/color_tools/yellow_bold_underline +0 -0
  130. data/src/color_tools/yellow_bold_underline.c +9 -12
  131. data/src/color_tools/yellow_underline +0 -0
  132. data/src/color_tools/yellow_underline.c +9 -12
  133. metadata +19 -8
  134. data/other/experimental_code/a/a.out +0 -0
  135. data/other/experimental_code/a/hello_world +0 -0
  136. data/other/experimental_code/c_program_faster +0 -0
  137. /data/other/experimental_code/{Resume.pdf → description_of_what_ive_done_old.pdf} +0 -0
  138. /data/other/experimental_code/{merge → merge.rb} +0 -0
@@ -0,0 +1,312 @@
1
+ #!/usr/bin/ruby
2
+
3
+ # frozen_string_literal: false
4
+ SPECIAL = {"cmd" => "command", "unix" => "UNIX"}
5
+
6
+ print "\rAUTOCORRECT\r\n"
7
+ require 'set'
8
+ $ln = Set.new File.read("/usr/share/dict/words").split
9
+ exc = %w[coo verb cad Mar Mao ma Mai Mae wag wan T's Th wad cab mad strep pi goo fob foe yo yon fog fop war i ] # '
10
+
11
+ exc.each do |i|
12
+ raise "No #{i}" unless $ln.include?(i)
13
+ end
14
+
15
+ $ln -= exc
16
+
17
+ LINES = "\n" << $ln.sort.reverse.join("\n") << "\n"
18
+
19
+ AMOUNT = 1
20
+ PUNCT = (("!".."@")).map do |i|
21
+ i.chr
22
+ end.reject do |i|
23
+ ("0".."9").include? i
24
+ end
25
+
26
+ #puts PUNCT.to_a.to_s
27
+
28
+ def get_word_(word)
29
+ return word if $ln.include? word
30
+ return word if $ln.include? word.downcase
31
+ return word.capitalize if $ln.include? word.capitalize
32
+
33
+ special = SPECIAL[word]
34
+ if special; return special; end
35
+
36
+ c = word.chars
37
+
38
+ i = c.size
39
+
40
+ def get(c, i)
41
+ return "" if c.size.zero?
42
+ while i != 0
43
+ c.permutation(i).each do |q|
44
+ # if q == first_len
45
+ # i-=1
46
+ # next
47
+ # end
48
+ q = q.join
49
+ len = LINES.scan(reg = /\n#{q}[^\n]*/i).map do |i|
50
+ i[1..-1]
51
+ end.sort do |a, b|
52
+ if a[0].downcase? == b[0].downcase?
53
+ a <=> b
54
+ else
55
+ b <=> a
56
+ end
57
+ end
58
+ # puts (len.reject do |i| i.size != 3; end.to_a.to_s)
59
+
60
+ # warn "\n#{q}[^\n]".inspect[1..-2].prepend('/').concat('/')
61
+ # warn format('permutation of %s chars of %s len of %s', i, q, len.inspect)
62
+ # return len
63
+ next if len.empty?
64
+
65
+ char_size = c.size
66
+ # puts char_size, len[0].size, len.to_s
67
+ # sleep
68
+ # puts len.inspect
69
+
70
+ len.each do |i|
71
+ cur_siz = i.size
72
+ # puts [i, c].to_s
73
+ next if cur_siz < char_size
74
+ next if cur_siz > char_size + AMOUNT
75
+
76
+ funcs = []
77
+ q.chars.each do |i|
78
+ funcs << if ("A".."Z").cover? i
79
+ :upcase
80
+ else
81
+ :downcase
82
+ end
83
+ end
84
+
85
+ funcs.size.times do |q|
86
+ i[q] = i[q].send funcs[q]
87
+ end
88
+ return i
89
+ end
90
+ end
91
+
92
+ i -= 1
93
+ end
94
+
95
+ "ERROR text is #{c.join.inspect}"
96
+ end
97
+
98
+ if i > 4
99
+ max = 0
100
+ l = $ln
101
+ maxes = {}
102
+
103
+ j = c.join
104
+
105
+ # puts 55
106
+
107
+ (c.size - c.size).times do |n|
108
+ n += 1
109
+ cont = 0
110
+ while cont < c.size
111
+ first = j[0..cont - 1]
112
+ second = j[cont..cont + n - 1].upcase.clear
113
+ third = j[n + cont..-1]
114
+ unless third
115
+ cont += 1
116
+ next
117
+ end
118
+ first = "" if cont.zero?
119
+
120
+ puts first + second + third
121
+ cont += 1
122
+ end
123
+
124
+ puts "DONE"
125
+ end
126
+ # puts 'DO'
127
+
128
+ l.each_with_index do |a, _index|
129
+ count = 0
130
+ orig_a = a.dup
131
+ a = a.dup
132
+
133
+ c.each do |char|
134
+ if a.include? char
135
+ count += 1
136
+ a.sub! char, ""
137
+ end
138
+ end
139
+
140
+ next unless count >= max && count != 0
141
+
142
+ # puts [count, max].to_s
143
+ maxes[orig_a] = count
144
+ max = count
145
+ end
146
+
147
+ maxes.select! do |_k, v|
148
+ v == max
149
+ end
150
+
151
+ l.each do |i_|
152
+ next if i_.size < c.size
153
+
154
+ maxes[i_] = max if i_[0..3] == c.join[0..3]
155
+ end
156
+ #puts l.size
157
+ def foo(a, b, c)
158
+ p = 0
159
+ while p < c.size && p < a.size
160
+ break if c[p] != a[p]
161
+
162
+ p += 1
163
+ end
164
+ p2 = 0
165
+ while p2 < c.size && p2 < b.size
166
+ break if c[p2] != b[p2]
167
+
168
+ p2 += 1
169
+ end
170
+
171
+ [p, p2]
172
+ end
173
+
174
+ val = maxes.keys.sort do |a, b|
175
+ p, p2 = foo(a, b, c)
176
+
177
+ if p2 - p >= 1
178
+ 1
179
+ elsif p2 == p2
180
+ 0
181
+ elsif p2 - p <= 1
182
+ -1
183
+ end
184
+ end[0..20].sort_by(&:size)[0..10].sort do |a, b|
185
+ p, p2 = foo(a, b, c)
186
+
187
+ if p2 - p >= 1
188
+ 1
189
+ elsif p2 == p2
190
+ 0
191
+ elsif p2 - p <= 1
192
+ -1
193
+ end
194
+ end[0]
195
+
196
+ raise unless val.class == String
197
+
198
+ return val
199
+ else
200
+ get(c, i)
201
+ end
202
+ end
203
+
204
+ require "io/console"
205
+
206
+ class String
207
+ def end?
208
+ self == "\r" || self == "\n" || self == "\t"
209
+ end
210
+
211
+ def downcase?
212
+ !!match(/[a-z]/)
213
+ end
214
+ end
215
+
216
+ class DoneException < Exception
217
+ end
218
+
219
+ def _get
220
+ a = nil
221
+ $c = ""
222
+ while a != " "
223
+ a = $stdin.getc
224
+ #print a.inspect
225
+ raise DoneException.new if a == "\x03"
226
+ if a == "\u007F"
227
+ $all_text = $all_text[0..-2]
228
+ $c = $c[0..-2]
229
+ print "\e[1D \e[1D"
230
+ next
231
+ end
232
+ $c << a
233
+ $all_text << a
234
+ putc(a) unless a.end?
235
+ return nil if a.end?
236
+ end
237
+
238
+ $c.chomp! " "
239
+ # $c.gsub!(/\e\[[A-Z]/, "")
240
+
241
+ # print c.inspect
242
+
243
+ File.open("words", "a") do |f|
244
+ f.puts c.inspect
245
+ end if false
246
+ c = $c
247
+
248
+ $c = ""
249
+ c
250
+ end
251
+
252
+ str = ""
253
+ $all_text = ""
254
+
255
+ $stdin.tty? && $stdin.raw do
256
+ last_char = "."
257
+ loop do
258
+ qi = _get
259
+ i=qi&.gsub(/\e\[[A-Z]/, "")
260
+
261
+
262
+ if i.nil?
263
+ print "\r\n"
264
+ next
265
+ end
266
+ if i.empty?
267
+ # print ' '
268
+ next
269
+ end
270
+
271
+ # raise if / |\e/.match?(i)
272
+
273
+ new_word = get_word_(i.sub(/[[:punct:]]+/, "")) + i.match(/[[:punct:]]+$/ ).to_s; if PUNCT.include?(last_char); new_word[0]=new_word[0].upcase; end
274
+ puts new_word.inspect if false
275
+
276
+ amount = i.size + 1
277
+ f = File.open("words", "a") if false
278
+
279
+ # if amount == 0
280
+ #
281
+ # text = ""/
282
+ #else
283
+ if new_word == i
284
+ else
285
+ print "\e[#{amount}D" << new_word << " "
286
+ end
287
+
288
+ $all_text = $all_text[0..-(1 + i.size + " ".size)]
289
+ $all_text << new_word << " "
290
+ last_char = new_word[-1]
291
+ # end
292
+
293
+ # puts new_word.inspect
294
+
295
+ #print "\u001b[0K"
296
+
297
+ #{new_word} "
298
+ end
299
+ rescue DoneException
300
+ end #rescue DoneException
301
+
302
+
303
+ #$all_text << $c
304
+ #system 'tput reset'
305
+ at=nil
306
+
307
+ #puts "\n\nYour story\n\n"
308
+ IO.popen("xclip -selection c", 'w') do |i|
309
+ i.print at=$all_text.strip
310
+ end
311
+ puts "YOUR STORY COPIED"
312
+ print at
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/ruby
2
+ # This is a work in progress.
3
+
4
+ ROMAN = /^([limcdvx]|[[:punct:]])+$/i
5
+
6
+ def capitalize(a)
7
+ a = a.gsub(/\s*(-|–|—|:)(-|–|—|:)*\s*/, "\\1 ")
8
+ w = a.split
9
+ not_major = /^(?:to|a|an|the|on|in|of|at|and|or|but|nor|for|yet|so)$/i
10
+ w = w.map do |i|
11
+ case i
12
+ when ROMAN
13
+ i.upcase
14
+ when /^(?:not|no|be|is|are|was|were|have|has|had|do|does|did|that|it|my|me|we|our|you|he|his|she|her|they|them|who)$/i
15
+ i.capitalize
16
+ when /(-|–|—|:)/
17
+ i.capitalize
18
+ when not_major
19
+ i.downcase
20
+ else
21
+ i.capitalize
22
+ end
23
+ end
24
+ w = w.to_a
25
+ if w.size == 0
26
+ w = [" "]
27
+ end
28
+ if w[0].match(ROMAN)
29
+ w[0] = w[0].upcase
30
+ else
31
+ w[0] = w[0].capitalize
32
+ end
33
+ if (w[-1].match(ROMAN))
34
+ w[-1] = w[-1].upcase
35
+ else
36
+ w[-1] = w[-1].capitalize
37
+ end
38
+ w = w.join(" ")
39
+ w = w.gsub "- ", "-"
40
+ w
41
+ end
42
+
43
+
44
+ print (capitalize ARGV.join(" "))
@@ -2,6 +2,14 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  PROG1 = %w[htmlbeautifier clang-format][1]
5
+ puts PROG1
6
+ print "OK ? "
7
+ response = ""
8
+ response = STDIN.readline.strip while response.empty?
9
+ if response.match /[nN]/
10
+ abort
11
+ end
12
+
5
13
  PROG2 = "rufo"
6
14
 
7
15
  require "tempfile"
@@ -1,5 +1,6 @@
1
1
  #!/bin/bash
2
2
 
3
+ cd ..
3
4
  set -e
4
5
  set -x
5
6
  export GIT_ASKPASS="$HOME/commit"
data/other/communicate ADDED
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
4
+ # BSD 2-Clause License
5
+ #
6
+ # Copyright (c) 2023, Gregory Cohen
7
+ # All rights reserved.
8
+ #
9
+ # Redistribution and use in source and binary forms, with or without
10
+ # modification, are permitted provided that the following conditions are met:
11
+ #
12
+ # 1. Redistributions of source code must retain the above copyright notice, this
13
+ # list of conditions and the following disclaimer.
14
+ #
15
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
16
+ # this list of conditions and the following disclaimer in the documentation
17
+ # and/or other materials provided with the distribution.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+ require 'colored'
30
+
31
+ str = 'Enter '
32
+
33
+ $old_str = ''
34
+ def puts__(str, ack = false)
35
+ # def puts.old_str
36
+ return unless ENV['C_CODE'].nil?
37
+ # if ENV["C_CODE
38
+ # if
39
+ # requi
40
+ return if $old_str == str
41
+
42
+ str = str.to_s
43
+ def str.colorify
44
+ bold.send ''.colors.sample
45
+ end
46
+
47
+ def str.ack
48
+ ['Thank you. '][0]
49
+ end
50
+
51
+ str.prepend str.ack if ack == true
52
+ print "#{str.colorify}\n"
53
+
54
+ system "echo '#{str}' | flite -voice slt "
55
+ end
56
+
57
+ alias :say puts__
58
+
59
+ count = 0
60
+ # speak str
61
+
62
+ def $stdin.readline
63
+ Dir.chdir Dir.home
64
+ Dir.chdir 'nerd-dictation'
65
+ res = ''
66
+ while res.strip == ''
67
+ res = %x(
68
+ ./nerd-dictation begin --vosk-model-dir=`printf "%s\n" ./vosk-model-small-en-us* | head -n 1` --timeout 1.0 2>&1 --output STDOUT)
69
+
70
+ res = '' if res.downcase.include?('no text')
71
+ # STDOUT.print res
72
+ end
73
+ res
74
+ end
75
+
76
+ loop do
77
+ puts__ ARGV[0], ack = false
78
+ $text = $stdin.readline
79
+
80
+ class Object
81
+ def eval(*_args)
82
+ text = $text
83
+ Kernel.eval to_s
84
+ end
85
+ end
86
+
87
+ ARGV[1..-1].map(&:eval)
88
+ end
@@ -1,18 +1,9 @@
1
1
  This is the entire stock history for the entire toronto stock exchange
2
2
 
3
-
4
-
5
3
  This information is given out very publically from many different sources and websites.
6
4
 
7
-
8
-
9
5
  Use this information for any purpose within reason.
10
6
 
11
-
12
-
13
7
  I do not condone or support any illegal activity.
14
8
 
15
-
16
- If I should or need to remove this from this repository, then please contact me and I can do so.
17
-
18
-
9
+ If I should or need to remove this from this repository, then please contact me and I can do so.
Binary file
@@ -1,12 +1,6 @@
1
1
  cd
2
2
 
3
-
4
- for i in Desktop/*; do gio set -t string "$i" metadata::caja-icon-position 00,00 ; caja -q &>/dev/null; done
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
3
+ for i in Desktop/*; do
4
+ gio set -t string "$i" metadata::caja-icon-position 00,00
5
+ caja -q &>/dev/null
6
+ done
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
-
4
- a= ('a' .. 'z').to_a
5
- a += ('A' .. 'Z').to_a
6
- a += (0 .. 9).to_a
7
- foo = (((0..199).to_a.map do |i|
8
- a.sample.to_s
3
+ a = ("a".."z").to_a
4
+ a += ("A".."Z").to_a
5
+ a += (0..9).to_a
6
+ foo = (((0..199).to_a.map do |i|
7
+ a.sample.to_s
9
8
  end).join)
10
9
 
11
- main_text = <<EOF
10
+ main_text = <<EOF
12
11
  From: <gregorycohenvideos@gmail.com>
13
12
  To: gregorycohenvideos@gmail.com
14
13
  MIME-Version: 1.0
@@ -19,15 +18,11 @@ Content-Type: text/plain; charset=utf-8
19
18
  Content-Transfer-Encoding: 7bit\n\nMessage\n
20
19
  EOF
21
20
 
22
-
23
21
  for arg in ARGV; file_text = File.read arg
24
- if file_text == foo
25
- raise
22
+ if file_text == foo
23
+ raise
26
24
  end
27
-
28
-
29
-
30
- main_text += <<EOF
25
+ main_text += <<EOF
31
26
 
32
27
  --#{foo}
33
28
  Content-Disposition: attachment; filename="#{arg}"
@@ -35,15 +30,11 @@ Content-Type: text/plain
35
30
 
36
31
  #{file_text}
37
32
 
38
- EOF
39
-
40
-
41
- end
33
+ EOF end
42
34
 
43
35
  main_text += "--#{foo}--"
44
36
  puts main_text
45
37
 
46
38
  IO.popen("himalaya send", "w") do |f|
47
- f.print main_text.gsub("\n", "\r\n")
39
+ f.print main_text.gsub("\n", "\r\n")
48
40
  end
49
-
@@ -1,5 +1,5 @@
1
1
  # !/usr/bin/ruby
2
- b = Dir.glob '*' # 0
2
+ b = Dir.glob "*" # 0
3
3
 
4
4
  def out(*a)
5
5
  print a.join(" ")
data/push_snap ADDED
@@ -0,0 +1,30 @@
1
+ #!/bin/bash
2
+
3
+ set -x
4
+ set -e
5
+
6
+ if [[ $2 = "" ]]; then
7
+ red_bold_underline OLD
8
+ nth 3 < *yaml | red_bold
9
+ red_bold VERSION AND REVISION ARE ARGS
10
+ exit 1
11
+ fi
12
+
13
+ rm -rf *snap democracy* 2>/dev/null
14
+
15
+
16
+
17
+ gsubip "1\.0\.\d+" 1.0.$1 snapcraft.yaml
18
+
19
+
20
+ cp /home/a/democracy -r . &>/dev/null
21
+ cd democracy
22
+ rm -fr .git
23
+ cd ..
24
+ tar cfz democracy.tar.gz democracy
25
+
26
+ snapcraft
27
+
28
+ snapcraft push democracy*snap
29
+
30
+ snapcraft release democracy $2 stable
Binary file
@@ -42,11 +42,11 @@
42
42
  #define FIRST_COLOR "\e[30m"
43
43
  #define SECOND_COLOR "\e[0m"
44
44
 
45
- int main(int argc, char** argv) {
46
- fputs(FIRST_COLOR, stdout);
47
45
 
48
-
46
+ int main(int argc, char** argv) {
49
47
  if (argc != 1) {
48
+ fputs(FIRST_COLOR, stdout);
49
+
50
50
  for (int i = 1; i < argc; ++i) {
51
51
  if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
52
52
  fputs(HELP_STR, stdout);
@@ -57,22 +57,19 @@ int main(int argc, char** argv) {
57
57
  }
58
58
 
59
59
  putchar('\n');
60
-
61
- goto end;
60
+
61
+ fputs(SECOND_COLOR, stdout);
62
+ return 0;
62
63
  }
64
+
65
+ fputs(FIRST_COLOR, stdout);
63
66
 
64
67
  for (;;) {
65
68
  const int c = getchar();
66
69
 
67
- if (c == EOF) goto end;
68
-
70
+ if (c == EOF) { fputs(SECOND_COLOR, stdout); return 0; }
69
71
  putchar(c);
70
72
  }
71
-
72
-
73
- end:
74
- fputs(SECOND_COLOR, stdout);
75
- return 0;
76
73
  }
77
74
 
78
75
 
Binary file
@@ -42,11 +42,11 @@
42
42
  #define FIRST_COLOR "\e[1m\e[30m"
43
43
  #define SECOND_COLOR "\e[0m\e[0m"
44
44
 
45
- int main(int argc, char** argv) {
46
- fputs(FIRST_COLOR, stdout);
47
45
 
48
-
46
+ int main(int argc, char** argv) {
49
47
  if (argc != 1) {
48
+ fputs(FIRST_COLOR, stdout);
49
+
50
50
  for (int i = 1; i < argc; ++i) {
51
51
  if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
52
52
  fputs(HELP_STR, stdout);
@@ -57,22 +57,19 @@ int main(int argc, char** argv) {
57
57
  }
58
58
 
59
59
  putchar('\n');
60
-
61
- goto end;
60
+
61
+ fputs(SECOND_COLOR, stdout);
62
+ return 0;
62
63
  }
64
+
65
+ fputs(FIRST_COLOR, stdout);
63
66
 
64
67
  for (;;) {
65
68
  const int c = getchar();
66
69
 
67
- if (c == EOF) goto end;
68
-
70
+ if (c == EOF) { fputs(SECOND_COLOR, stdout); return 0; }
69
71
  putchar(c);
70
72
  }
71
-
72
-
73
- end:
74
- fputs(SECOND_COLOR, stdout);
75
- return 0;
76
73
  }
77
74
 
78
75
 
Binary file