Skip to content

Instantly share code, notes, and snippets.

View aruprakshit's full-sized avatar
🏠
Working from home

Arup Rakshit aruprakshit

🏠
Working from home
View GitHub Profile
@JamesDullaghan
JamesDullaghan / digitalocean.md
Created July 6, 2013 20:54
Deploy rails app to digitalocean with nginx, unicorn, capistrano & postgres

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email

@naaman
naaman / delete-heroku-apps.sh
Last active March 5, 2021 20:57
[WARNING THIS WILL HARD DELETE YOUR APPS. YOU COULD LOSE DATA. MAKE SURE YOU KNOW WHAT YOURE DOING!!!!!!!!!!] Delete all heroku apps from bash terminal -- no script file required
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done
@Kartones
Kartones / sublime-text-cheatsheet.md
Last active January 18, 2021 17:43
Sublime Text 3 Cheatsheet

Keyboard shorcuts

  • CTRL + SHIFT + p: Command panel
  • CTRL + p: File search
  • CTRL + r: Method search inside current file
  • CTRL + g: Go to line #
  • CTRL + SHIFT + [: Fold code
  • CTRL + SHIFT + ]: Unfold code
  • ALT + SHIFT + 2: Double column/file mode
  • ALT + SHIFT + 1: Single column/file mode
@AlanWarren
AlanWarren / vim
Created September 4, 2019 13:18
" snippets
Plug 'SirVer/ultisnips'
Plug 'atefth/ruby-on-rails-snippets-vs-code'
Plug 'abusaidm/html-snippets'
Plug 'wvffle/vimterm'
Plug 'mtdl9/vim-log-highlighting'
Plug 'vim-ruby/vim-ruby'
Plug 'joker1007/vim-ruby-heredoc-syntax'
Plug 'chase/vim-ansible-yaml'
/* eslint-disable jsx-a11y/accessible-emoji */
import React, { Suspense, useState } from "react";
import { unstable_scheduleCallback } from "scheduler";
import { unstable_createResource as createResource } from "react-cache";
import {
Combobox,
ComboboxInput,
ComboboxList,
ComboboxOption,
ComboboxOptionText
@juliocesar
juliocesar / testing_front_end_rspec_capybara.md
Created October 21, 2010 23:51
Testing front-end for a Sinatra app with RSpec and Capybara

Testing front-end for a Sinatra app with RSpec and Capybara

I've used Cucumber quite a bit on my last job. It's an excellent tool, and I believe readable tests are the way to the future. But I could never get around to write effective scenarios, or maintain the boatload of text that the suite becomes once you get to a point where you have decent coverage. On top of that, it didn't seem to take much for the suite to become really slow as tests were added.

A while ago I've seen a gist by Lachie Cox where he shows how to use RSpec and Capybara to do front-end tests. That sounded perfect for me. I love RSpec, I can write my own matchers when I need them with little code, and it reads damn nicely.

So for my Rails Rumble 2010 project, as usual, I rolled a Sinatra app and figured I should give the idea a shot. Below are my findings.

Gemfile

@turbod
turbod / copy_carrierwave_files.rb
Created March 17, 2014 12:26
Copy carrierwave files to another model
original_solution.files.each do |original_file|
f = original_file.dup
f.remote_name_url = original_file.name.url
new_solution.files << f
end
@panthomakos
panthomakos / group.rb
Created September 20, 2011 23:09
Improved Custom Error Messages in Ruby
class Group
module Error
class Standard < StandardError; end
class AlreadyAMember < Standard; end
class NotPermittedToJoin < Standard; end
end
def join user
raise Error::NotPermittedToJoin unless self.permitted?(user)
raise Error::AlreadyAMember if self.member?(user)
@panthomakos
panthomakos / group.rb
Created September 20, 2011 22:57
Custom Error Messages in Ruby
class Group
module Error
class Standard < StandardError; end
class AlreadyAMember < Standard
def message
"You are already a member of this group."
end
end
@rajeevkannav
rajeevkannav / README.md
Created April 4, 2012 10:59 — forked from jpantuso/README.md
Deploying Rails to Linode

Deploying Rails to Linode

Installing Ruby Enterprise Edition, Apache, MySQL, and Passenger for deploying Rails 3.0 applications.

Get a Linode, and set it up with Ubuntu 10.04 LTS so that you have till April 2013 to get updates. Once the Linode is formatted, boot it and continue on.

Set up an 'A' record in your DNS, pointing to the IP of your Linode. I'm using demo.napcs.com here.

Initial setup