Skip to content

Instantly share code, notes, and snippets.

@6temes
6temes / mysql_downgrade.txt
Last active October 28, 2024 01:07
Downgrade MySQL version with brew
# Kill rails server and guard
bin/spring stop
brew services stop mysql
brew uninstall mysql
brew install [email protected]
brew link [email protected] --force
brew services start [email protected]
rbenv uninstall 2.3.3
rbenv install 2.3.3
gem install bundle
@brandondurham
brandondurham / styles.less
Last active June 24, 2024 14:48
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):
@danielchappell
danielchappell / route_hooks.js
Last active February 27, 2023 13:34
Ember.Route hook order
import Ember from 'ember';
// Ember 1.10
export default Ember.Route.extend({
//---fire in order on route enter---
beforeModel(transition) {
//empty by default
@stereodenis
stereodenis / gist:d5749a0f17b1b53b5963
Last active August 10, 2021 17:00
social meta tags helper ruby on rails 4
def social_meta_tags
title = "#{(content_for?(:title) ? (strip_tags(content_for(:title)).html_safe + ' / ') : '')}#{t('project_title')}"
description = content_for?(:description) ? content_for(:description) : ''
image = if @doc.present?
image_url(@doc.cover_photo.cover.url)
elsif @main.present?
image_url(@main.cover_photo.cover.url)
else
''
end

Commands examples

If the namespace is not used then the commands will perform on top of the default database. bundle exec rake db:create bundle exec rake db:migrate

By using the namespace we are going to use all the configuration for our alternate DB. bundle exec rake store:db:create bundle exec rake store:db:migrate

@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@seyhunak
seyhunak / bootstrap-confirmation.js
Created June 28, 2013 09:08
Twitter Bootstrap Confirmation Dialog Modal - Rails UJS
$.rails.allowAction = function(link) {
if (!link.attr('data-confirm')) {
return true;
}
$.rails.showConfirmDialog(link);
return false;
};
$.rails.confirmed = function(link) {
link.removeAttr('data-confirm');
@digitaljhelms
digitaljhelms / gist:4287848
Last active April 2, 2025 13:40
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 9, 2025 11:55
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@chetan
chetan / yardoc_cheatsheet.md
Last active April 3, 2025 18:35
YARD cheatsheet