Skip to content

Instantly share code, notes, and snippets.

Cezar Halmagean chalmagean

Block or report user

Report or block chalmagean

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View _form_errors.html.erb
<% if obj.errors.any? %>
<div class="row form-errors">
<div class="col-md-12">
<section class="panel">
<div class="panel-body">
<div class="alert alert-warning alert-block fade in">
<button data-dismiss="alert" class="close close-sm" type="button">
<i class="fa fa-times"></i>
</button>
<h4>
@chalmagean
chalmagean / Upgrade from Maveriks to Yosemite
Last active Aug 29, 2015
Upgrade from Maveriks to Yosemite
View Upgrade from Maveriks to Yosemite
https://developer.apple.com/downloads/index.action
Install XCode 6.1
Install Command line tools OSX 10.10 for Xcode
``
rvm get stable
rvm reinstall ruby-2.0.0-p195
rvm gemset pristine
```
@chalmagean
chalmagean / template.rb
Last active Aug 29, 2015
Rails Template
View template.rb
# Here's how you generate the app
# rails new YourNewApp-m template.rb -B -T
# Gems
# ==================================================
# Use unicorn as the app server
gem 'unicorn'
if yes?("Use ExceptionNotifier?")
View GrepPartial
" Find where a partial is called
" With no arguments it uses the current file name to do the search.
" You can also pass a string to search for and it will do a search for
" a line matching render.*<your_string>
function! GrepPartial(...)
if a:0
let pattern = "render.*" . a:0
else
let filename = substitute(expand("%:t:r:r"), "^_", "", "")
let pattern = "render.*" . filename
@chalmagean
chalmagean / pre-push
Created Jul 8, 2015
Pre-Push git hook to run specs before pushing
View pre-push
#!/bin/sh
# Put it in .git/hooks/pre-push
branch=`git rev-parse --abbrev-ref HEAD`
exit_code=$(bundle exec rspec --fail-fast --out /dev/null --format progress > /dev/null 2>/dev/null )$?
if [ $exit_code -gt 0 ]
then echo "Did not push because of failing tests"
fi
View alchemy_cms.gemspec
# -*- encoding: utf-8 -*-
# stub: alchemy_cms 4.0.0.beta ruby lib
Gem::Specification.new do |s|
s.name = "alchemy_cms"
s.version = "4.0.0.beta"
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Thomas von Deyen", "Robin Boening", "Marc Schettke", "Hendrik Mans", "Carsten Fregin"]
View gist:d3efd5f9dabc0db496a2
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
View env.rb
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
require 'cucumber/rails'
# Capybara defaults to CSS3 selectors rather than XPath.
# If you'd prefer to use XPath, just uncomment this line and adjust any
View rails_helper.rb
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require 'spec_helper'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
# Add additional requires below this line. Rails is not loaded until this point!
require "shoulda/matchers"
require 'paperclip/matchers'
require 'vcr'
require 'paper_trail/frameworks/rspec'
View gist:5f77692037eaef9dc41590bd9fc25701
type Action
= NoOp
| UpdateProtein String
view : Signal.Address Action -> Model -> Html
view address model =
div [] [
div [] [
input
[ type' "text"
You can’t perform that action at this time.