Skip to content

Instantly share code, notes, and snippets.

View kenmazaika's full-sized avatar

ken mazaika kenmazaika

View GitHub Profile
// String Functions
func substr(input: String, start: Int, count: Int) {
var substr = ""
for i in range(0, input.length) {
if(i >= start && i <= start + count - 1 ) {
substr = substr + input[i]
}
}
func add(a: Int, b: Int) {
a + b
}
func mult(a: Int, b: Int) {
a * b
}
func combine(a: Int, b: Int, comp: (Int, Int) => Int) {
// Convert Celsius to degrees Fahrenheit
func convert(celsius: Float) {
celsius * 9 / 5 + 32
}
val input = 45.0
println("The temperature " + input + " Celsius is " + convert(input) + " Fahrenheit")
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "helm-chart.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "helm-chart.name" . }}
helm.sh/chart: {{ include "helm-chart.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Flashback</title>
<script src="https://unpkg.com/@babel/[email protected]/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>
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'
class LinkedListNode
attr_accessor :value, :next_node
def initialize(value, next_node=nil)
@value = value
@next_node = next_node
end
end
class Stack
<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;
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;"
curl https://toolbelt.heroku.com/install.sh | sh
echo 'PATH="/usr/local/heroku/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
heroku