Skip to content

Instantly share code, notes, and snippets.

View prio101's full-sized avatar
:shipit:
Making Stuff

Mahabub Islam Prio prio101

:shipit:
Making Stuff
View GitHub Profile
defmodule TodoList.Repo.Migrations.CreateTasks do
use Ecto.Migration
def change do
create table("tasks") do
add :task_name, :string
add :task_description, :string
add :task_status, :string
timestamps()
end
defmodule TodoList.Task do
use Ecto.Schema
import Poison
alias TodoList.Repo
schema "tasks" do
field :task_name
field :task_description
field :task_status
@prio101
prio101 / dev.exs
Last active August 28, 2018 18:58
use Mix.Config
config :todolist, TodoList.Repo, [
adapter: Ecto.Adapters.Postgres,
database: "todolist_#{Mix.env}",
username: "postgres",
password: "",
hostname: "localhost",
]
defmodule StillOn do
import IO
def yeah do
puts "I am Still on it"
end
end
@prio101
prio101 / postgres-cheatsheet.md
Created April 21, 2016 16:16 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@prio101
prio101 / vim_cheatsheet.md
Created March 17, 2016 18:12 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@prio101
prio101 / .vimrc
Created March 7, 2016 18:03
Vim Vundle gist
" ---------------------- USABILITY CONFIGURATION ----------------------
" Basic and pretty much needed settings to provide a solid base for
" source code editting
" don't make vim compatible with vi
set nocompatible
" turn on syntax highlighting
syntax on
" and show line numbers
<?php
namespace App\Http\Controllers\Api\V1;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Psy\Util\Json;
@prio101
prio101 / excelSheetConvert.php
Last active January 22, 2016 03:54
Please check this
<?php
use Maatwebsite\Excel\Excel;
use Carbon\Carbon;
use App\Model\BokkingsModel;
class SomeController extends Controller{
/**
* Export to Excel data sheet
*
# Testing the response
test "should get the home index" do
assert_routing 'admin/home' , {controller: 'admin/home/home' , action: 'index' }
assert_response :success
end
test "should go into the home index with okay response" do
get :index
assert_response :success
end