Skip to content

Instantly share code, notes, and snippets.

<?php
class User extends UserAbstract {
public $old_password;
public $auth_hash;
public $usernameOnForum;
@Darkside73
Darkside73 / gist:1f1a34e13d585fddeb20
Created March 18, 2015 09:41
Ruby mixin example with configurable methods
require 'active_support'
module Connectable
extend ActiveSupport::Concern
def connect
puts "connecting with #{self.class.params}"
end
class_methods do
@Darkside73
Darkside73 / chpwd_profiles.plugin.zsh
Created July 24, 2014 12:39
Oh-my-zsh: alias rails, rake commands to generated spring binstubs on entering project's directory
# put this file to $HOME/.oh-my-zsh/custom/plugins/chpwd_profiles
# and add plugin name to .zshrc: plugins=(... chpwd_profiles)
function chpwd_profiles() {
local -x profile
zstyle -s ":chpwd:profiles:${PWD}" profile profile || profile='default'
if (( ${+functions[chpwd_profile_$profile]} )) ; then
chpwd_profile_${profile}
fi
@Darkside73
Darkside73 / gist:05560a085522f0cfbe15
Created July 24, 2014 09:21
Create rails application with rvm gemset
#! /bin/sh
source "$HOME/.rvm/scripts/rvm"
app_name=$1
rvm default
current_ruby=`rvm current`
echo "Creating gemset ${app_name}..."
rvm gemset create $app_name
error = "<%= escape_javascript flash[:error] %>"
unless error
$('tr#<%= dom_id(@category) %>').fadeOut()
else
$('#content').prepend("<%= escape_javascript render(partial: 'flashes') %>")