Skip to content

Instantly share code, notes, and snippets.

View zmiftah's full-sized avatar
💭
Waiting List ...

Zein Miftah zmiftah

💭
Waiting List ...
  • West Java, Indonesia
View GitHub Profile
@zmiftah
zmiftah / apigen_snippet.sh
Created March 7, 2016 09:38
PHP Api Generator Command Line Snippet
apigen generate --source "$1" --destination "$2" --template-theme bootstrap --title "$3"
@zmiftah
zmiftah / random_my_decision_making.js
Created February 24, 2016 02:24
Random My Decision Making
/* Write in Console, your choice */
["Choice 1", "Choice 2", "Choice 3"][Math.round(Math.random())]
@zmiftah
zmiftah / postgre_enum_type.sql
Last active January 6, 2017 11:54
Postgre | Enum Type
-- Create Enum
CREATE TYPE enum_type AS ENUM ('Value 1', 'Value 2');
-- List All Enum
SELECT UNNEST(ENUM_RANGE(null::enum_type));
-- Add Value
ALTER TYPE enum_type ADD VALUE 'New Value';
-- Delete Value
@zmiftah
zmiftah / postgre_amounts_in_top_programs.sql
Last active February 23, 2016 04:43
Postgres | Per Ipp Amount Totals in Only The Top Programs
WITH all_ipp AS (
SELECT program_id, SUM(total_amount_eqv) AS total_amount
FROM pdg.ipp
GROUP BY program_id
), top_ipp AS (
SELECT program_id
FROM all_ipp
WHERE total_amount > (SELECT SUM(total_amount)/10 FROM all_ipp)
)
SELECT
@zmiftah
zmiftah / springer-free-maths-books.md
Created December 29, 2015 05:58 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@zmiftah
zmiftah / introrx.md
Created October 17, 2015 06:59 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@zmiftah
zmiftah / postgres_json_func.sql
Last active September 19, 2015 10:25
Postgres Json func
-- Row to json (per row)
SELECT row_to_json(project) FROM (
SELECT * FROM pdg.project WHERE id=1750
) project
-- Ex
SELECT row_to_json(datum) FROM (SELECT 'ID' AS id, 'Name' AS name) AS datum
-- Aggregate Row to Array json
SELECT json_agg(project) FROM (
SELECT * FROM pdg.project WHERE id=1750
@zmiftah
zmiftah / The Technical Interview Cheat Sheet.md
Last active August 26, 2015 09:34 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@zmiftah
zmiftah / libreoffice_convert_from_command.sh
Created August 24, 2015 09:39
Libreoffice Export to Xlsx From Command Line
libreoffice --headless --convert-to xlsx --outdir . list_mitra_with_program.csv
@zmiftah
zmiftah / linux_sudo_with_parameter.sh
Created August 11, 2015 09:55
Sudo with password parameter
echo 'password' | sudo -S apt-get install package