Skip to content

Instantly share code, notes, and snippets.

View ismaild's full-sized avatar
🥊
Building Things...

Ismail Dhorat ismaild

🥊
Building Things...
View GitHub Profile
@ismaild
ismaild / error_rspec.txt
Created February 28, 2013 07:54
Get the following error when trying to run rspec without using spork, if i disable better_errors & binding of caller this error goes away.
/Users/idhorat/.rvm/gems/ruby-1.9.3-p362@chow/gems/better_errors-0.3.2/lib/better_errors/core_ext/exception.rb:9: [BUG] Segmentation fault
ruby 1.9.3p362 (2012-12-25 revision 38607) [x86_64-darwin11.4.2]
-- Control frame information -----------------------------------------------
c:0061 p:---- s:0194 b:0194 l:000193 d:000193 CFUNC :callers
c:0060 p:0072 s:0191 b:0191 l:000fc0 d:000950 LAMBDA /Users/idhorat/.rvm/gems/ruby-1.9.3-p362@chow/gems/better_errors-0.3.2/lib/better_errors/core_ext/exception.rb:9
c:0059 p:---- s:0188 b:0188 l:000187 d:000187 FINISH
c:0058 p:---- s:0186 b:0186 l:000185 d:000185 CFUNC :new
c:0057 p:---- s:0184 b:0184 l:000183 d:000183 CFUNC :require
c:0056 p:0012 s:0180 b:0180 l:000c08 d:000158 BLOCK /Users/idhorat/.rvm/gems/ruby-1.9.3-p362@chow/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251
@ismaild
ismaild / confirmations_controller.rb
Last active December 14, 2015 13:59
Delayed Job
def create
if @confirmation.save
OrderMailer.delay.order_notification(@order)
@ismaild
ismaild / error_routing.txt
Last active December 14, 2015 21:49
Heroku compile assets error with unicorn, routing error with subdomain.
2013-03-17T20:35:04+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/v1/cities.json"):
2013-03-17T20:35:04+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-03-17T20:35:04+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2013-03-17T20:35:04+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/rack/logger.rb:32:in `call_app'
2013-03-17T20:35:04+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/rack/logger.rb:16:in `block in call'
2013-03-17T20:35:04+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/tagged_logging.rb:22:in `tagged'
2013-03-17T20:35:04+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/rack/logger.rb:16:in `call'
2013-03-17T20:35:04+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.9
%ul.nav.pull-right
- actions(:root).each do |action|
%li= link_to wording_for(:menu, action), { :action => action.action_name, :controller => 'rails_admin/main' }, :class => 'pjax'
- if main_app_root_path = (main_app.root_path rescue false)
%li= link_to t('admin.home.name').capitalize, main_app_root_path
- if _current_user
- if user_link = edit_user_link
%li= user_link
- if logout_path.present?
%li= link_to content_tag('span', t('admin.misc.log_out'), :class => 'label label-important'), logout_path, :method => Devise.sign_out_via
@ismaild
ismaild / mysql_uninstall.txt
Last active March 13, 2017 14:54
uninstall mysql, Mac OSX
1. Backup any databases you have using mysqldump
2. Stop MySQL using the pref panel
3. Open Terminal and type in the following commands
4. sudo rm /usr/local/mysql
5. sudo rm -rf /usr/local/mysql*
6. sudo rm -rf /Library/StartupItems/MySQLCOM
7. sudo rm -rf /Library/PreferencePanes/My*
8. edit /etc/hostconfig and remove the line MYSQLCOM=-YES- (May not be necessary)
9. rm -rf ~/Library/PreferencePanes/My*
10. sudo rm -rf /Library/Receipts/mysql*
@ismaild
ismaild / github_error.txt
Created September 3, 2013 12:38
stange error trying to push to github
GIT_CURL_VERBOSE=1 GIT_TRACE=1 git push origin source
trace: built-in: git 'push' 'origin' 'source'
trace: run_command: 'ssh' 'git@github.com' 'git-receive-pack '\''ismaild/ismaild.github.io.git'\'''
ERROR: Permission to ismaild/ismaild.github.io.git denied to codiez/codiez.github.io.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
------
@ismaild
ismaild / .bash_profile
Created September 11, 2013 09:44
git config
source ~/.git-completion.bash
@ismaild
ismaild / sublime_projects.py
Created October 14, 2013 10:26
Create sublime projects from a root directory with all your code
'''
Create sublime projects from a root directory with all your code
Sublime projects are just JSON files, describing the project
'''
import os
SUBLIME_PROJECT_DIR = 'sublime_projects'
SUBLIME_PROJECT_EXT = '.sublime-project'
@ismaild
ismaild / replace.sh
Created October 30, 2013 10:01
Replace all occurrences of a a string from all files in a directory
ruby -pi.bak -e 'gsub(/"SOME_TEXT"\./, "REPLACE_TEXT")' *.sql
@ismaild
ismaild / traceroute_obiwan.scrye.net
Created November 26, 2013 15:10
traceroute -m 200 obiwan.scrye.net
traceroute -m 200 obiwan.scrye.net
traceroute to obiwan.scrye.net (204.244.252.35), 200 hops max, 52 byte packets
1 192.168.16.20 (192.168.16.20) 7.534 ms 4.420 ms 2.951 ms
2 41.161.72.225 (41.161.72.225) 6.101 ms 5.317 ms 5.075 ms
3 41.160.24.13 (41.160.24.13) 7.364 ms 9.033 ms 8.662 ms
4 * * *
5 41.160.0.243 (41.160.0.243) 10.521 ms 8.304 ms 8.235 ms
6 41.160.0.242 (41.160.0.242) 10.024 ms 9.046 ms 13.001 ms
7 ix-0-3-0-0.tcore1.jso-johannesburg.as6453.net (216.6.55.37) 53.576 ms 9.311 ms 9.040 ms
8 if-4-2.tcore1.klt-capetown.as6453.net (41.206.178.2) 183.272 ms 183.199 ms 180.528 ms