Skip to content

Instantly share code, notes, and snippets.


Roman Pramberger b1nary

View GitHub Profile
b1nary /
Last active January 29, 2020 22:21

As soon as i apply the rule to a coupon i get the following when i try to apply it:

  "success": null,
  "error": "This coupon code could not be applied to the cart at this time.",
  "successful": false,
  "status_code": "coupon_code_unknown_error"
b1nary /
Last active January 12, 2020 16:10
Bootstrap 4 2nd Level Menu "Hack"

Bootstrap 4 2nd Level Menu "Hack"

I was looking for some basic CSS to gain a second level for my Bootstrap 4 menu. To my surprise what i found was a lot of jQuery, a lot of pre-styled glitchy examples and not at all what i was actually looking for. Some markup was so bad i felt like puking when i tried to "fix" the bad examples.

So without further internet and subtle jQuery bashing, i'll present, a simple second level for Bootstrap 4 Menüs!

  • No CSS weirdness
  • Works with every template
  • No jQuery (or sane Javascript)
View i
if [ $1 = "love" ]; then
if [ "$EUID" -ne 0 ]; then
echo "i have a boyfriend"
echo "i love $2 too"
b1nary / index.php
Last active November 9, 2017 01:34
PHP yield?
View index.php
<?php layout("Title goes here"){ ?>
Content in here should yield into the body
<?php } ?>
b1nary / favicon_finder.rb
Created July 15, 2017 16:28
Basic but well working way to find favicons by domain in Ruby
View favicon_finder.rb
class FaviconFinder
require 'open-uri'
attr_accessor :favicon_url
def initialize domain = ""
@favicon_url = nil
["/favicon.ico", "/favicon.png"].each do |file|
url = "http://#{domain}#{file}"
uri = URI(url)
View foobar_controller.rb
class FooBarController < ApplicationController
before_action :set_stuff
def create
# same as below
def destroy
# remove beeing a method on the foo object here
b1nary / _sidebar.html.erb
Last active January 19, 2017 10:56 Blog Post about creating a Blog in Rails
View _sidebar.html.erb
<a href="/blog/feed.rss" class="rss" target="_blank">
<i class="fa fa-rss" aria-hidden="true"></i> RSS Feed
<div class="list-group">
<a href="<%= blogs_path %>" class="list-group-item"><strong>Show All</strong></a>
<% Blog.pluck(:category).uniq.sort.each do |cat| %>
<a href="<%= blogs_path %>?category=<%= cat %>" class="list-group-item"><%= cat %></a>
<% end %>
b1nary / slack_test.js
Created November 26, 2016 21:00
Slack Test
View slack_test.js
// I think it semi embeds gists
// Does it?
b1nary /
Last active May 22, 2018 18:03
Tumblr Repost & Reddit post bots

Tumblr Repost & Reddit post bots

I've created these inspired by before i realized its not worth it for me :) Maybe some of you can user it, the code is messy and could be optimized, its also not very beautiful and done in a hurry.

But the bot worked perfectly for the last month or so, so i figured why not post it when i dont use it anyway?

Installing & Using

It needs Ruby, this is super easy if you are not using Windows.

b1nary /
Created October 5, 2016 22:54 — forked from agnoster/
My ZSH Theme


A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark