Skip to content

Instantly share code, notes, and snippets.


Alexander Presber momolog

View GitHub Profile

Keybase proof

I hereby claim:

  • I am momolog on github.
  • I am saimiri ( on keybase.
  • I have a public key ASC-Jrd7IYVblYeHOQZZM4f_lvM7wK1e9Wp-UbiwXg2KrAo

To claim this, I am signing this object:

View gist:fa6ed94b77e98e38eea474699a71683a
#!/usr/bin/env ruby
require 'json'
require 'httparty'
headers = {
(1..121).each do |pid|
momolog / githost-move-vars
Last active May 29, 2019
githost to gitlab variable transfer
View githost-move-vars
#!/usr/bin/env ruby
# move me to ~/bin/githost-move-vars, make me executable and
# call me like githost-move-vars 101 1258608
require "httparty"
# only works for up to 100 variables
# doesn't copy protected nor masked checkboxes
momolog / nap
Created Jan 30, 2019
nap utility, put this into `~/bin/nap`
View nap
if [ -z $1 ]; then
echo "No time provided. Usage: nap [-cl] [minutes]"
exit 2
if [[ $1 == *c ]]; then
echo Cancelling sleep. PIDs \(if any\): `pgrep -f "nap"`
pkill -f "nap"
exit 0
momolog / test.rb
Created Mar 9, 2018
Runs just fine with "ruby test.rb" under ruby 2.5
View test.rb
require 'factory_bot'
class Training
attr_accessor :instructor
def save!; end
class User
attr_accessor :role
def save!; end
momolog / Gemfile
Created Feb 25, 2018 — forked from roalcantara/Gemfile
Rails 4 + Paperclip + Amazon S3
View Gemfile
gem 'paperclip', github: 'thoughtbot/paperclip'
# S3 API
gem 'aws-sdk'
View PHP emptiness
Test $a $b
isset() false false
empty() true true
is_null() true true
=== null true true
View Ruby Struct Initialization
2.2.2 :010 > s =
=> #<Class:0x007fc96203f2e0>
2.2.2 :011 > my_struct = s['value']
=> #<struct member="value">
View offcanvas.sass
$navi-width: 200px
height: 100%
margin: 0
margin: 0
height: 100%
position: relative
{div, h1, h2, img, form, input} = React.DOM
@SearchBox = React.createClass
render: ->
div className: 'searchbox-container',
React.createElement Form, searchText: this.state.searchText, onSearchChange: this.searchChanged, onFocus: this.onFocus, onBlur: this.onBlur
React.createElement ResultList, data:, category: this.state.category, visible: (this.state.hasResults && this.state.focus)
searchChanged: (val) ->