Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

antonio lorusso zekus

🏠
Working from home
Block or report user

Report or block zekus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am zekus on github.
  • I am lantonio (https://keybase.io/lantonio) on keybase.
  • I have a public key whose fingerprint is 3131 5BAA 97C0 40C3 106D 9DC9 3B60 30A7 F97C 0240

To claim this, I am signing this object:

@zekus
zekus / docker-for-mac-shit
Created May 9, 2017
Docker-for-Mac patches
View docker-for-mac-shit
#!/bin/bash
# ref: https://github.com/docker/for-mac/issues/668
set -e
cd ~/Library/Containers/com.docker.docker/Data/database
echo -n "Current full-sync-on-flush setting: "
cat ./com.docker.driver.amd64-linux/disk/full-sync-on-flush
echo
@zekus
zekus / nginx.conf
Last active Aug 29, 2015
local nginx development for ssl
View nginx.conf
daemon off;
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
View nginx_gen_cert.rb
#!/usr/bin/env ruby
# Pass in the name of the site you wich to create a cert for
domain_name = ARGV[0]
if domain_name == nil
puts "Y U No give me a domain name?"
else
system "openssl genrsa -out #{domain_name}.key 1024"
system "openssl req -new -key #{domain_name}.key -out #{domain_name}.csr -subj '/C=US/ST=NJ/L=Monroe/O=MyCompany/OU=IT/CN=#{domain_name}'"
View reports_mailer_spec.rb
require 'spec_helper'
describe ReportsMailer do
describe 'sending a report' do
let(:user) { build(:user) }
let(:report_mailing) { build(:report_mailing_with_contact) }
describe 'sends the PDF report to the selected contacts' do
let(:email) { ReportsMailer.visit_report(report_mailing, user, false) }
View app_delegate.rb
class AppDelegate
include BW::KVO
attr_accessor :user
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.applicationFrame)
@window.makeKeyAndVisible
View errors.rb
# -*- coding: utf-8 -*-
require 'active_support/core_ext/array/conversions'
require 'active_support/core_ext/string/inflections'
module ActiveModel
# == Active \Model \Errors
#
# Provides a modified +Hash+ that you can include in your object
# for handling error messages and interacting with Action Pack helpers.
@zekus
zekus / gist:6133437
Created Aug 1, 2013
Make pow like rvm again
View gist:6133437
# run this in the project directory
rvm env . -- --env > .powenv
@zekus
zekus / Vagrantfile
Created Jun 20, 2013
the vagrant file to launch a Dokku test box ;)
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define :dokku do |dokku|
dokku.vm.box = "raring64"
dokku.vm.box_url = "http://cloud-images.ubuntu.com/raring/current/raring-server-cloudimg-vagrant-amd64-disk1.box"
dokku.vm.network :private_network, ip: "192.168.33.10"
dokku.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
@zekus
zekus / gist:5141731
Last active Dec 14, 2015
intersect two hashes based on their keys.
View gist:5141731
class Hash
def intersect_by_keys(another_hash)
delete_if {|k, v| !another_hash.has_key?(k) }
end
end
{a: 'one', b: 'two'}.intersect_by_keys({a: 'three', d: 'four'}) #=> {:a=>"one"}
You can’t perform that action at this time.