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

Here's how to install PostgreSQL and have it run automatically at startup, on an Ubuntu 10.04 virtual machine using Vagrant. This took me a while to figure out:

Add the default lucid32 base box to your vagrant, if you haven't already:

host> vagrant box add lucid32 http://files.vagrantup.com/lucid32.box 

Now make a new lucid32 virtual machine and install postgresql on it:

=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
======== LOG OF FAILED TESTS ========
Your solution achieved a testing score of 180 out of 190.
Below you can see a short feedback for every test that failed, indicating the reason
for the test failure and how many points you lost for each individual test.
[Test Description] pascal: base cases
[Observed Error] java.lang.ArithmeticException: / by zero
[exception was thrown] detailed error message in debug output section below
[Lost Points] 10
@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/
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

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.

@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
@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 / 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'>
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