Skip to content

Instantly share code, notes, and snippets.

ken mazaika kenmazaika

Block or report user

Report or block kenmazaika

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
View reactdom.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Flashback</title>
<script src="https://unpkg.com/@babel/standalone@7.2.5/babel.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.0.0/umd/react.development.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.0.0/umd/react-dom.development.js"></script>
<link rel="stylesheet" type="text/css" href="index.css"></link>
</head>
View cloud9-postgres-setup.sh
sudo mv /var/lib/pgsql9/data/postgresql.conf /var/lib/pgsql9/data/postgresql-old.conf
sudo curl -o /var/lib/pgsql9/data/postgresql.conf https://gist.githubusercontent.com/kenmazaika/7bc24fb5541de023fbc8b942e05a1c5c/raw/faa529be3b46eb036229114c15faffa9acbf43a0/postgresql.conf
sudo mv /var/lib/pgsql9/data/pg_hba.conf /var/lib/pgsql9/data/pg_hba-old.conf
sudo curl -o /var/lib/pgsql9/data/pg_hba.conf https://gist.githubusercontent.com/kenmazaika/75d310aaf1509a8a8f95c28cc7c14202/raw/9a681b510fdaac78fbe3c4aa955a101b9fad6487/pg_hba.conf
sudo /etc/init.d/postgresql start
sudo sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'password';"
sudo sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';"
sudo sudo -u postgres psql -c "DROP DATABASE template1;"
sudo sudo -u postgres psql -c "CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';"
sudo sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1'
View linked_list2.rb
class LinkedListNode
attr_accessor :value, :next_node
def initialize(value, next_node=nil)
@value = value
@next_node = next_node
end
end
class Stack
View ajax.html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<h1 id="headline">Hi Karla</h1>
<button id="btn">Click me!!!</button>
<script>
// var movieName = "Sharknado";
// var apiKey = "4ce5edcc";
// var queryURL = "http://www.omdbapi.com/?t=" + movieName + "&apikey=" + apiKey;
View postgres-setup-c9.sh
sudo yum install -y postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs
sudo service postgresql initdb
sudo mv /var/lib/pgsql9/data/postgresql.conf /var/lib/pgsql9/data/postgresql-old.conf
sudo curl -o /var/lib/pgsql9/data/postgresql.conf https://gist.githubusercontent.com/kenmazaika/1beee173b4b9172c27b165a722edb849/raw/7bf8880d9ae32e80c08f79a22713b5c68b1ddece/postgres.conf
sudo mv /var/lib/pgsql9/data/pg_hba.conf /var/lib/pgsql9/data/pg_hba-old.conf
sudo curl -o /var/lib/pgsql9/data/pg_hba.conf https://gist.githubusercontent.com/kenmazaika/3c14af3e78f12be2bc11d806e2a2f0ec/raw/32eef13ac302e6d10158a18f8d13d0e6120b19c2/pg_hba.conf
sudo service postgresql restart
sudo sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'password';"
sudo sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';"
sudo sudo -u postgres psql -c "DROP DATABASE template1;"
View heroku-cloud9.sh
curl https://toolbelt.heroku.com/install.sh | sh
echo 'PATH="/usr/local/heroku/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
heroku
View cloud9-setup.sh
sudo yum install -y postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs
sudo service postgresql initdb
sudo mv /var/lib/pgsql9/data/postgresql.conf /var/lib/pgsql9/data/postgresql-old.conf
sudo curl -o /var/lib/pgsql9/data/postgresql.conf https://gist.githubusercontent.com/kenmazaika/1beee173b4b9172c27b165a722edb849/raw/7bf8880d9ae32e80c08f79a22713b5c68b1ddece/postgres.conf
sudo mv /var/lib/pgsql9/data/pg_hba.conf /var/lib/pgsql9/data/pg_hba-old.conf
sudo curl -o /var/lib/pgsql9/data/pg_hba.conf https://gist.githubusercontent.com/kenmazaika/3c14af3e78f12be2bc11d806e2a2f0ec/raw/32eef13ac302e6d10158a18f8d13d0e6120b19c2/pg_hba.conf
sudo service postgresql restart
sudo sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'password';"
sudo sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';"
sudo sudo -u postgres psql -c "DROP DATABASE template1;"
View pg_hba.conf
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file. A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
View file
sudo yum install -y postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs
sudo service postgresql initdb
sudo mv /var/lib/pgsql9/data/postgresql.conf /var/lib/pgsql9/data/postgresql-old.conf
sudo curl -o /var/lib/pgsql9/data/postgresql.conf https://gist.githubusercontent.com/kenmazaika/1beee173b4b9172c27b165a722edb849/raw/7bf8880d9ae32e80c08f79a22713b5c68b1ddece/postgres.conf
echo -e "\n\nhost all postgres 127.0.0.1/0 trust" >> /var/lib/pgsql9/data/pg_hba.conf
sudo service postgresql restart
sudo sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'password';"
sudo sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';"
sudo sudo -u postgres psql -c "DROP DATABASE template1;"
sudo sudo -u postgres psql -c "CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';"
View file
sudo yum install postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs
sudo service postgresql initdb
sudo mv /var/lib/pgsql9/data/postgresql.conf /var/lib/pgsql9/data/postgresql-old.conf
sudo curl -o /var/lib/pgsql9/data/postgresql.conf https://gist.githubusercontent.com/kenmazaika/1beee173b4b9172c27b165a722edb849/raw/7bf8880d9ae32e80c08f79a22713b5c68b1ddece/postgres.conf
echo -e "\n\nhost all postgres 127.0.0.1/0 trust" >> /var/lib/pgsql9/data/pg_hba.conf
sudo service postgresql restart
sudo sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'password';"
sudo sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';"
sudo sudo -u postgres psql -c "DROP DATABASE template1;"
sudo sudo -u postgres psql -c "CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';"
You can’t perform that action at this time.