Skip to content

Instantly share code, notes, and snippets.

View marjinal1st's full-sized avatar
🥃
Master of Ballmer Peak

Ahmet Sezgin DURAN marjinal1st

🥃
Master of Ballmer Peak
View GitHub Profile
@marjinal1st
marjinal1st / gist:7870389
Created December 9, 2013 10:44
HABTM Error
Kebapress::Post.includes(:categories).where(categories: { count: 0 })
SQL (0.3ms) SELECT "kebapress_posts"."id" AS t0_r0, "kebapress_posts"."title" AS t0_r1, "kebapress_posts"."body" AS t0_r2, "kebapress_posts"."published_at" AS t0_r3, "kebapress_posts"."commentable" AS t0_r4, "kebapress_posts"."published" AS t0_r5, "kebapress_posts"."author_id" AS t0_r6, "kebapress_posts"."created_at" AS t0_r7, "kebapress_posts"."updated_at" AS t0_r8, "kebapress_categories"."id" AS t1_r0, "kebapress_categories"."title" AS t1_r1, "kebapress_categories"."created_at" AS t1_r2, "kebapress_categories"."updated_at" AS t1_r3 FROM "kebapress_posts" LEFT OUTER JOIN "kebapress_categories_posts" ON "kebapress_categories_posts"."post_id" = "kebapress_posts"."id" LEFT OUTER JOIN "kebapress_categories" ON "kebapress_categories"."id" = "kebapress_categories_posts"."category_id" WHERE "categories"."count" = 0
SQLite3::SQLException: no such column: categories.count: SELECT "kebapress_posts"."id" AS t0_r0, "kebapress_posts"."title" AS t0_
@marjinal1st
marjinal1st / gist:7870427
Created December 9, 2013 10:48
HABTM Error 2
SELECT "kebapress_posts"."id" AS t0_r0, "kebapress_posts"."title" AS t0_r1, "kebapress_posts"."body" AS t0_r2, "kebapress_posts"."published_at" AS t0_r3, "kebapress_posts"."commentable" AS t0_r4, "kebapress_posts"."published" AS t0_r5, "kebapress_posts"."author_id" AS t0_r6, "kebapress_posts"."created_at" AS t0_r7, "kebapress_posts"."updated_at" AS t0_r8, "kebapress_categories"."id" AS t1_r0, "kebapress_categories"."title" AS t1_r1, "kebapress_categories"."created_at" AS t1_r2, "kebapress_categories"."updated_at" AS t1_r3 FROM "kebapress_posts" LEFT OUTER JOIN "kebapress_categories_posts" ON "kebapress_categories_posts"."post_id" = "kebapress_posts"."id" LEFT OUTER JOIN "kebapress_categories" ON "kebapress_categories"."id" = "kebapress_categories_posts"."category_id" WHERE "categories"."id" IS NULL
SQLite3::SQLException: no such column: categories.id: SELECT "kebapress_posts"."id" AS t0_r0, "kebapress_posts"."title" AS t0_r1, "kebapress_posts"."body" AS t0_r2, "kebapress_posts"."published_at" AS t0_r3, "kebap
Started GET "/blog/hq/categories/new" for 127.0.0.1 at 2013-12-14 11:39:07 +0200
Processing by Kebapress::Hq::CategoriesController#new as HTML
Rendered /home/marjinal1st/Ruby/Work/kebapress/app/views/kebapress/hq/categories/_form.html.haml (55.9ms)
Rendered /home/marjinal1st/Ruby/Work/kebapress/app/views/kebapress/hq/categories/new.html.haml within layouts/hq/application (56.8ms)
Completed 500 Internal Server Error in 60ms
Rendered /home/marjinal1st/.rvm/gems/ruby-2.0.0-p247/gems/exception_notification-4.0.1/lib/exception_notifier/views/exception_notifier/_request.text.erb (0.3ms)
Rendered /home/marjinal1st/.rvm/gems/ruby-2.0.0-p247/gems/exception_notification-4.0.1/lib/exception_notifier/views/exception_notifier/_title.text.erb (0.1ms)
Rendered /home/marjinal1st/.rvm/gems/ruby-2.0.0-p247/gems/exception_notification-4.0.1/lib/exception_notifier/views/exception_notifier/_session.text.erb (0.1ms)
Rendered /home/marjinal1st/.rvm/gems/ruby-2.0.0-p247/gems/exception_notification-4.0.1/lib/exception_not
Routes for Kebapress::Engine:
posts GET /posts(.:format) kebapress/posts#index
post GET /posts/:id(.:format) kebapress/posts#show
hq_dashboard_index GET /hq/dashboard(.:format) kebapress/hq/dashboard#index
hq_posts GET /hq/posts(.:format) kebapress/hq/posts#index
POST /hq/posts(.:format) kebapress/hq/posts#create
new_hq_post GET /hq/posts/new(.:format) kebapress/hq/posts#new
edit_hq_post GET /hq/posts/:id/edit(.:format) kebapress/hq/posts#edit
hq_post GET /hq/posts/:id(.:format) kebapress/hq/posts#show
PATCH /hq/posts/:id(.:format) kebapress/hq/posts#update
@marjinal1st
marjinal1st / gist:8144677
Created December 27, 2013 09:45
JS Error
<!DOCTYPE html>
<!--[if IE 8]> <html class="no-js lt-ie10 lt-ie9" lang="en-us"> <![endif]-->
<!--[if IE 9]> <html class="no-js lt-ie10 lt-ie9" lang="en-us"> <![endif]-->
<!--[if lt IE 10]> <html class="no-js lt-ie10" lang="en-us"> <![endif]-->
<html class='no-js' lang='en'>
<head>
<title></title>
<meta charset='utf-8' content='text/html' http-equiv='content-type'>
<meta content='ie=edge,chrome=1' http-equiv='x-ua-compatible'>
@marjinal1st
marjinal1st / gist:8470400
Created January 17, 2014 09:06
Generator
require 'rails/generators'
require 'rails/generators/base'
require 'rails/generators/migration'
require 'rails/generators/active_record'
module Kebapress
module Generators
class InstallGenerator < Rails::Generators::NamedBase
source_root File.expand_path('../templates', __FILE__)
include Rails::Generators::Migration
@marjinal1st
marjinal1st / devise_layout.rb
Created February 22, 2014 10:38
Devise Controller Layout Change
config.to_prepare do
Devise::SessionsController.layout "login"
Devise::RegistrationsController.layout proc{ |controller| user_signed_in? ? "application" : "devise" }
Devise::RegistrationsController.layout "login"
Devise::ConfirmationsController.layout "login"
Devise::UnlocksController.layout "login"
Devise::PasswordsController.layout "login"
Devise::InvitationsController.layout "admin"
end

rage-quit plugin for oh-my-zsh

based on rage-quit support for bash

HOW TO INSTALL

Put the files below inside ~/.oh-my-zsh/custom/plugins/fuck

Also chmod a+x the flip command.

def setup_profile_routes
inject_into_file 'config/routes.rb', :after => "namespace :hq do\n" do <<-RUBY
# Routing for admin profile editing
match '/profile', to: 'profile#edit', via: :get
match '/profile', to: 'profile#update', via: [:patch, :put]
RUBY
end
end
@marjinal1st
marjinal1st / gist:10584957
Last active August 29, 2015 13:59
Freeswitch portaudio
# BUILD ERRORS
making all mod_portaudio
libtool: link: gcc -o bin/paqa_devs -I./include -I./src/common -I./src/os/unix -g -O2 -DPA_LITTLE_ENDIAN -pthread -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_SYS_SOUNDCARD_H=1 -DHAVE_LINUX_SOUNDCARD_H=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=8 -DHAVE_CLOCK_GETTIME=1 -DHAVE_NANOSLEEP=1 -DPA_USE_ALSA=1 -DPA_USE_JACK=1 -DPA_USE_OSS=1 ./test/paqa_devs.c lib/.libs/libportaudio.a -lasound -ljack -lrt -lm -lpthread -pthread
lib/.libs/libportaudio.a(pa_unix_oss.o): In function `PaOssStream_WaitForFrames':
/home/marjinal1st/C/freeswitch/libs/portaudio/src/hostapi/oss/pa_unix_oss.c:1333: undefined reference to `__fdelt_chk'
/home/marjinal1st/C/freeswitch/