Skip to content

Instantly share code, notes, and snippets.

View tghastings's full-sized avatar
🎯
Focusing

Tom Hastings tghastings

🎯
Focusing
View GitHub Profile
## show.html.erb
<p>
<b>Title:</b>
<%= editable_field @project, :title %>
</p>
<p>
##project_controller.rb
Parameters: {"project"=>{"title"=>"dfdf"}, "id"=>"2"}
Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", "2"]]
(0.0ms) begin transaction
(0.2ms) UPDATE "projects" SET "title" = 'dfdf', "updated_at" = '2012-04-30 19:46:43.332038' WHERE "projects"."id" = 2
(6.1ms) commit transaction
Completed 500 Internal Server Error in 10ms
ArgumentError (too few arguments):
app/controllers/projects_controller.rb:65:in `format'
app/controllers/projects_controller.rb:65:in `update'
def update
@project = Project.find(params[:id])
@project.update_attributes!(params[:project])
format.html {
if request.xhr?
# *** repond with the new value ***
render :text => params[:project].values.first
else
redirect_to(@project, :notice => 'User was successfully updated.')
// Place your settings in this file to overwrite the default settings
{
"editor.renderLineHighlight": "none",
"editor.renderWhitespace": "all",
"workbench.iconTheme": "vs-minimal",
"editor.dragAndDrop": true,
}
####
source /usr/share/git-core/contrib/completion/git-prompt.sh
#
# Set the prompt #
#
# Select git info displayed, see /usr/lib/git-core/git-sh-prompt for more
export GIT_PS1_SHOWDIRTYSTATE=1 # '*'=unstaged, '+'=staged
export GIT_PS1_SHOWSTASHSTATE=1 # '$'=stashed
export GIT_PS1_SHOWUNTRACKEDFILES=1 # '%'=untracked
export GIT_PS1_SHOWUPSTREAM="verbose" # 'u='=no difference, 'u+1'=ahead by 1 commit
@tghastings
tghastings / Dockerfile
Last active July 16, 2018 00:37
Dockerfile Cloud9 Django
FROM bizcapdev/base-python-alpine-django
RUN apk --update add build-base g++ make curl wget openssl-dev apache2-utils git libxml2-dev sshfs nodejs bash tmux sqlite-dev postgresql-dev mysql-dev supervisor \
&& rm -f /var/cache/apk/* \
&& git clone https://github.com/c9/core.git /cloud9 \
&& cd cloud9 \
&& curl -s -L https://raw.githubusercontent.com/c9/install/master/link.sh | bash \
&& /cloud9/scripts/install-sdk.sh \
&& sed -i -e 's_127.0.0.1_0.0.0.0_g' /cloud9/configs/standalone.js \
&& mkdir /workspace \
@tghastings
tghastings / centos.install.boost.md
Created April 15, 2019 18:16 — forked from 1duo/centos.install.boost.md
Install Boost library from source on CentOS 7.

Download Boost Library: http://www.boost.org (Choose the expected version)

wget https://cfhcable.dl.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.gz
wget https://phoenixnap.dl.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz
wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz
language: ruby
cache: bundler
bundler_args: --without production
rvm:
- 2.5.7
before_install:
- gem install bundler:2.0.2
@tghastings
tghastings / jira-docker-compose.yml
Last active September 18, 2020 18:57
jira-docker-compose.yml
version: '3'
services:
jira:
image: atlassian/jira-software
depends_on:
- postgresql
container_name: jira
restart: always
ports:
- '80:8080'
language: ruby
cache: bundler
bundler_args: --without production
rvm:
- 2.5.7
before_install:
- gem install bundler:2.0.2