Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

leyla KAPİ leylaKapi

I may be slow to respond.
Block or report user

Report or block leylaKapi

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
bonkydog / db.rake
Last active Dec 27, 2017
Fix 'ERROR: must be owner of extension plpgsql' complaints from Postgresql when dumping and reloading structure.sql
View db.rake
# Put this in your Rails app's lib/tasks directory
namespace :db do
desc "Fix 'ERROR: must be owner of extension plpgsql' complaints from Postgresql"
task :fix_psql_dump do |task|
filename = ENV['DB_STRUCTURE'] || File.join(ActiveRecord::Tasks::DatabaseTasks.db_dir, "structure.sql")
sql =
sql.sub!(/(CREATE EXTENSION IF NOT EXISTS plpgsql)/, '-- \1')
sql.sub!(/(COMMENT ON EXTENSION plpgsql)/, '-- \1'), 'w') do |f|
## Run this script with root user
# After installation check this
# vi /etc/ssh/sshd_config # Change ssh post
# vi /etc/environment # Write below locales
# LANGUAGE="en_US.utf8"
# LC_ALL="en_US.utf8"
# dpkg-reconfigure locales # Configure locales
## Fancy echo
fancy_echo() {
ismailakbudak /
Last active Aug 31, 2015
## Run this command with deploy user
# define user home path
## Fancy echo
fancy_echo() {
printf "\n%b\n" "$1"
fancy_echo "Installing rbenv..."
git clone git:// $user_path/.rbenv
# Deploy group
# Deploy user
# Github usernames for access with ssh to deploy user
usernames=(tayfunoziserikan ismailakbudak)
# Check user is exist
id -u $deploy_user &> /dev/null
if [ $? -ne 0 ]
shime /
Last active Apr 5, 2020
The Qlobe - by Yusuke Endoh


Qlobe is a fascinating example of quine in Ruby, submitted by a member of the Ruby core team - Yusuke Endoh.

Programs that output changed executable versions of themselves while managing to spin the globe and still remaining executable are cool, right?

To experience its magic, run the following

curl -fSSl > qlobe.rb; while true; do ruby qlobe.rb | tee temp.rb; sleep 1; mv -f temp.rb qlobe.rb; done
rxaviers / gist:7360908
Last active May 28, 2020
Complete list of github markdown emoji markup
View gist:7360908


:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
una / sassy-shapes
Last active Apr 18, 2019
Sassy Shape Machine Mixin :) Make Sassy shapes in seconds!
View sassy-shapes
// Some cute colors:
$color1: #967bd3;
$color2: #c8815b;
$color3: #8cd6d8;
$color4: #bee6b6;
$color5: #dd9bb9;
$color6: #c4b5e6;
$color7: #cb6363;
//Here's where you make the shapes!
kyletcarlson / rspec_model_testing_template.rb
Last active May 21, 2020
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
View rspec_model_testing_template.rb
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
# @kyletcarlson
# This skeleton also assumes you're using the following gems:
meSingh /
Last active Dec 24, 2018
Sublime Text Installation Instructions for Ubuntu 13.04 and Elementary OS Luna

Sublime Text 2 Installation Guide: Ubuntu 13.04 and Elementary OS Luna

1. Install Sublime Text 2

Open terminal

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

2. Install Sublime Package Control

terryjray / gist:3296171
Created Aug 8, 2012
Enabling hstore for new postgresql 9.1 and rails 3 install on ubuntu 12.04
View gist:3296171
RAILS_ENV=production rake db:setup
# produces the error's a no-worky
psql:/yourprojectpath/yourproject/db/structure.sql:29: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory
# hstore postgresql extension needs to be installed, so....
sudo apt-get install postgresql-contrib
# now your extension should be available to enable so log in with psql
psql -d yourproject_production -U yourdbuser -W
You can’t perform that action at this time.