Skip to content

Instantly share code, notes, and snippets.

View sabcio's full-sized avatar

Sebastian Wojtczak sabcio

View GitHub Profile
@sabcio
sabcio / gist:8419310
Created January 14, 2014 14:41
Rakefile
namespace :db do
task :migrate do
Rake::Task['ar:migrate'].invoke
end
namespace :schema do
task :load do
Rake::Task['ar:schema:load'].invoke
end
end
@sabcio
sabcio / gist:6106900
Last active December 20, 2015 09:19
Trying out emberJS
App = Ember.Application.create();
App.Store = DS.Store.extend({
revision: 12,
adapter: "DS.RESTAdapter"
});
controller (coffee):
App.ApplicationController = Ember.Controller.extend(
mainPages: App.Page.find
@sabcio
sabcio / gist:4493871
Last active December 10, 2015 21:18
Load error when working with ActiveSupport::Concern
# app/models/something.rb
class Something < ActiveRecord::Base
...
end
# app/models/example.rb
class Example < ActiveRecord::Base
include Something # (I get the error here)
...
@sabcio
sabcio / mashForm.js
Created November 26, 2015 18:22
react this.refs is {}
class MashForm extends React.Component{
constructor(props){
super(props)
this.state = {malts: []}
}
componentDidMount() {
this._fetchIngredients()
}
@sabcio
sabcio / after_restart
Created April 11, 2012 15:07
After restart hook - Shelly Cloud
mkdir -p disk/assets
mkdir -p disk/system
ln -s ../disk/assets public/assets
ln -s ../disk/system public/system
@sabcio
sabcio / gist:0067456c38e5448118be
Created February 18, 2015 10:43
Diff mariadb cookbook
diff --git a/templates/default/my.cnf.erb b/templates/default/my.cnf.erb
index 5f4f737..fcc41da 100644
--- a/templates/default/my.cnf.erb
+++ b/templates/default/my.cnf.erb
@@ -323,6 +323,12 @@ skip-show-database
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
+<% if node['mariadb'].key?('options') -%>
+<% node['mariadb']['options'].each { |key, value| -%>
@sabcio
sabcio / gist:b8fca9d9194c10bed361
Created December 15, 2014 11:58
influxdb warn/errors
[2014/12/15 12:55:46 CET] [EROR] (github.com/influxdb/influxdb/api/graphite.(*Server).Serve:120) GraphiteServer: Accept: %!(EXTRA *errors.errorString=use of closed network connection)
[2014/12/15 12:55:46 CET] [WARN] (github.com/influxdb/influxdb/api/graphite.(*Server).ServeUdp:140) GraphiteServer: Error when reading from UDP connection use of closed network connection
@sabcio
sabcio / config.js
Created October 29, 2014 07:57
Grafana config file
///// @scratch /configuration/config.js/1
// == Configuration
// config.js is where you will find the core Grafana configuration. This file contains parameter that
// must be set before Grafana is run for the first time.
///
define(['settings'],
function (Settings) {
return new Settings({
@sabcio
sabcio / Gemfile
Last active August 29, 2015 14:06
Simple Rack application to server static content
source :rubygems
gem 'rack'
gem 'rake'
gem 'thin', group: :production
@sabcio
sabcio / gist:35783b5dcc043177c6cf
Created July 9, 2014 09:29
shelly install of a fresh setup
➜ ~ rvm use ruby-2.0.0-p451@test
Using /Users/sebek/.rvm/gems/ruby-2.0.0-p451 with gemset test
➜ ~ gem list
*** LOCAL GEMS ***
bundler (1.6.1, 1.5.2)
bundler-unload (1.0.2)
executable-hooks (1.3.1)