Skip to content

Instantly share code, notes, and snippets.

View alexbevi's full-sized avatar
🙀

Alex Bevilacqua alexbevi

🙀
View GitHub Profile
@alexbevi
alexbevi / migrator
Created October 17, 2012 19:29 — forked from avsej/migrator
script/migrator for easier navigation of migrations
#!/usr/bin/env ruby
# Simple migration navigator for terminal.
#
# Install
# 1) Throw this code into script/migrator
# 2) chmod +x script/migrator
#
# Alternative install
# 1) Put this script into your executable path (e.g. ~/bin)
/home/maximus/workspaces/cpp/scummvm/engines/tucker/detection.cpp
{ "tucker", "Bud Tucker in Double Trouble" },
/home/maximus/workspaces/cpp/scummvm/engines/uplink/detection.cpp
{"uplink", "Uplink: Hacker Elite"},
/home/maximus/workspaces/cpp/scummvm/engines/parallaction/detection.cpp
{"parallaction", "Parallaction engine game"},
{"nippon", "Nippon Safes Inc."},
{"bra", "The Big Red Adventure"},
@alexbevi
alexbevi / dfs-activity-report.sql
Created January 16, 2013 17:42
DFS Activity Report Lists owners/portals/projects based on their status and outputs the result directly
/*
DFS Activity Report
Lists owners/portals/projects based on their status and outputs the result directly
----
Copyright (C) 2013 Astley Gilbert Limited
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
@alexbevi
alexbevi / redmine_view_hooks.md
Last active November 1, 2021 10:09
A list of the view hooks that are registered in Redmine

Redmine View Hooks

The following is a list of the registered view hooks available in Redmine, as of version 2.3.3.

These have been listed in the form of

:name_of_hook
path/to/file: { :param_1, :param_2, ... :param_n}
# Allows you to build a Hash in a fashion very similar to Builder. Example:
# Fork of https://gist.github.com/360506 by BrentD with some enhancements
#
# HashBuilder.build! do |h|
# h.name "Nilesh"
# h.skill "Ruby"
# h.skill "Rails" # multiple calls of the same method will collect the values in an array
# h.location "Udaipur, India" do # If a block is given, first argument will be set as value for :name
# h.location do
# h.longitude 24.57
@alexbevi
alexbevi / development.log
Created March 24, 2014 17:21
Rails log with a long-running mongoid request that was killed with CTRL+C
Started GET "/users/5323168a616c65771a030000/edit" for 127.0.0.1 at 2014-03-24 13:01:53 -0400
Processing by UsersController#edit as HTML
Parameters: {"id"=>"5323168a616c65771a030000"}
MOPED: 1.1.1.1:27017 COMMAND database=admin command={:ismaster=>1} runtime: 36.5997ms
MOPED: 1.1.1.1:27017 QUERY database=phoenix collection=users selector={"$query"=>{"_id"=>BSON::ObjectId('53207289616c652137000000')}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 batch_size=nil fields=nil runtime: 38.2057ms
MOPED: 1.1.1.1:27017 COMMAND database=phoenix command={:count=>"roles", :query=>{"$and"=>[{"_id"=>{"$in"=>[BSON::ObjectId('53207289616c652137010000'), BSON::ObjectId('53207293616c652137020000')]}}], "$or"=>[{"name"=>"super_user", "resource_type"=>nil, "resource_id"=>nil}]}} runtime: 28.6933ms
MOPED: 1.1.1.1:27017 QUERY database=phoenix collection=users selector={"_id"=>BSON::ObjectId('5323168a616c65771a030000')} flags=[] limit=0 skip=0 batch_size=nil fields=nil runtime: 24.3522ms
MOPED:
class Square: NamedShape {
var sideLength: Double
init(sideLength: Double, name: String) {
self.sideLength = sideLength
super.init(name: name)
numberOfSides = 4
}
func area() -> Double {

You have your Rails Apps with specific Gemsets in RVM.

The following commands creates a wrapped unicorn_rails bin. Be sure to replace the variables and that you have unicorn in your bundle.

rvmsudo rvm wrapper [RUBY VERSION]@[GEMSET] [GEMSET] unicorn_rails

Now you have a /usr/local/rvm/bin/[GEMSET]_unicorn_rails I will refer to [GEMSET]_unicorn_rails as [WRAPPED_NAME]

@alexbevi
alexbevi / galleria_tag.rb
Last active November 20, 2016 21:59 — forked from kyv/photos_tag.rb
Galleria Tag for Jekyll/Octopress
# Title: Galleria Tag for Jekyll
# Authors: Alex Bevilacqua
# Description: incorporate the Galleria gallery jquery plugin
#
# Adaption of "Photos tag for Jekyll" by Devin Weaver, and the derived
# "Gallery Tag for Jekyll" by Kevin Brown.
#
# Installation:
#
# {% galleria_includes %}
@alexbevi
alexbevi / mongo-linter.config.json
Last active August 29, 2015 14:11
Sample configuration for use with mongo-linter's travis configuration
{
"databaseUrl" : "mongodb://test:[email protected]:27771/mongo-linter-test"
}