Skip to content

Instantly share code, notes, and snippets.

View atomaka's full-sized avatar

Andrew Tomaka atomaka

View GitHub Profile
@formatted = Hash.new
# controller getting fat.
@printers.each do |printer|
if not @formatted.has_key?(printer.aoplocation.code)
@formatted[printer.aoplocation.code] = Hash.new
end
@formatted[printer.aoplocation.code][printer.computers] = {
'queue' => printer.queue,
BASE52_CHARACTERS = Array('0'..'9') + Array('A'..'Z') + Array('a'..'z') - 'AEIOUaeiou'.split(//)
class String
def from_52
i = 0
decoded = 0
self.split(//).reverse.each do |a|
place = 52 ** i
decoded += BASE52_CHARACTERS.index(a) * place
#!/usr/bin/env ruby
def reader file
problems = file.readline.to_i
problems.times do
numbers_count = file.readline.to_i
numbers = Array.new
(1..numbers_count).each do
# GITLAB
# Maintainer: @randx
# App Version: 5.0
upstream gitlab {
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
}
@atomaka
atomaka / gist:6057803
Last active December 20, 2015 02:39
Puppet Run
Info: Class[Msugitlab::Config]: Scheduling refresh of Service[gitlab]
Debug: Service[nginx](provider=upstart): Could not find nginx.conf in /etc/init
Debug: Service[nginx](provider=upstart): Could not find nginx.conf in /etc/init.d
Debug: Service[nginx](provider=upstart): Could not find nginx in /etc/init
Debug: Executing '/etc/init.d/nginx status'
@atomaka
atomaka / example-gitlab.pp
Last active December 22, 2015 18:29
vagrant-gitlab modifications
# Configure a GitLab server (gitlab.domain.tld)
node /default/ {
$gitlab_dbname = 'gitlab_prod'
$gitlab_dbuser = 'labu'
$gitlab_dbpwd = 'labpass'
class { 'depends':
gitlab_dbname => $gitlab_dbname,
gitlab_dbuser => $gitlab_dbuser,
gitlab_dbpwd => $gitlab_dbpwd,
@atomaka
atomaka / gist:6921528
Created October 10, 2013 16:41
Stack Trace
git@gitlab:~/gitlab$ /usr/bin/yes yes | bundle exec rake gitlab:setup RAILS_ENV=production
rake aborted!
(<unknown>): found character that cannot start any token while scanning for the next token at line 46 column 1
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/settingslogic-2.0.9/lib/settingslogic.rb:103:in `initialize'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/settingslogic-2.0.9/lib/settingslogic.rb:60:in `new'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/settingslogic-2.0.9/lib/settingslogic.rb:60:in `instance'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/settingslogic-2.0.9/lib/settingslogic.rb:37:in `[]'
/home/git/gitlab/config/initializers/1_settings.rb:38:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
class Dashing.Verbinski extends Dashing.Widget
@accessor 'current_icon', ->
getIcon(@get('current.icon'))
@accessor 'day_icon', ->
getIcon(@get('today.icon'))
ready: ->
# This is fired when the widget is done being rendered

Keybase proof

I hereby claim:

  • I am atomaka on github.
  • I am atomaka (https://keybase.io/atomaka) on keybase.
  • I have a public key whose fingerprint is 1772 ED1E 5B79 DA9E 3F44 1EC7 56A1 AD86 9996 CB50

To claim this, I am signing this object:

FROM alpine:latest
RUN apk add --update nginx && \
rm -rf /var/cache/apk/* && \
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
CMD ["nginx"]