This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@karretlink = Karretlink.new(params[:karretlink]) | |
respond_to do |format| | |
if @karretlink.save | |
format.html { redirect_to @karretlink, notice: 'Your Karret was successfully created.' } | |
format.json { render json: @karretlink, status: :created, location: @karretlink } | |
else | |
flash.now.alert = "Something went wrong, Make sure to fill up everything. ( Make sure Karet's name have no space or special symbol)" | |
current_uri = request.env['PATH_INFO'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var chart = []; // globally available | |
$(document).ready(function() { | |
chart[0] = new Highcharts.Chart({ | |
chart: { | |
renderTo: 'graphMonths', | |
defaultSeriesType: 'column' | |
}, | |
title: { | |
text: '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git switch <branch> | |
# Switches to branch. Stashes and restores unstaged changes. | |
$ git sync | |
# Syncronizes current branch. Auto-merge/rebase, un/stash. | |
$ git publish <branch> | |
# Publishes branch to remote server. | |
$ git unpublish <branch> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Devise::PasswordsController < DeviseController | |
before_filter :mobile_layout | |
private | |
def mobile_layout | |
request.format = :mobile if android_device? | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%p | |
%i | |
some text | |
TM | |
%i | |
some other text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var plugin = $['ui']['autocomplete'].prototype; | |
// store copies of the original plugin functions before overwriting | |
var functions = {}; | |
for (var i in plugin) { | |
if (typeof(plugin[i]) === 'function') { | |
functions[i] = plugin[i]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Last login: Tue Dec 20 12:50:04 on ttys003 | |
zsh: command not found: rvm-prompt | |
╭─jon-paullussier@georges-imac ~ ‹› | |
╰─$ echo $PATH | |
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin | |
zsh: command not found: rvm-prompt | |
╭─jon-paullussier@georges-imac ~ ‹› | |
╰─$ rvm use default | |
Using /Users/jon-paullussier/.rvm/gems/ruby-1.8.7-p352 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def search | |
search_terms = params[:query] | |
simple_search_bucket(search_terms) | |
search_results = Hash.new | |
orgs_array.each do |uid| | |
search_results[uid] = {} | |
search_results[uid][:search] = Listing.search do | |
size 3 | |
query { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= semantic_form_for @peon, :as => @peon, :url => registration_path(@peon) do |f| | |
=f.inputs :email, :email_confirmation, :password, :password_confirmation, :job_title, :first_name, :last_name | |
=f.inputs do | |
=f.input :organization_id, :as => :hidden, :input_html => {:value => "#{@organization.id}"} | |
=f.buttons |