Skip to content

Instantly share code, notes, and snippets.

View boudra's full-sized avatar
✌️

Mohamed Boudra boudra

✌️
View GitHub Profile
@boudra
boudra / Animated login form.markdown
Created May 19, 2015 11:06
Animated login form
@boudra
boudra / parallel_map.exs
Created May 18, 2016 16:04
Parallel Map in Elixir
def parallel_map(enum, cb) do
Enum.map(enum, &(Task.async(fn() -> apply(cb, [&1]) end)))
|> Enum.map(&Task.await(&1))
end
@boudra
boudra / csv_to_sql.php
Created October 5, 2016 08:17
Convert a CSV file with a header to a CREATE + INSERT sql script
<?php
$file = $argv[1];
$table_name = $argv[2];
$lines = file($file);
$header = array_shift($lines);
$fields = str_getcsv(trim($header));

Keybase proof

I hereby claim:

  • I am boudra on github.
  • I am moboudra (https://keybase.io/moboudra) on keybase.
  • I have a public key ASCIwdtWKnvBAL_Pq69ufFrx9Y6RZmr_l0OiBgr_t-xf5wo

To claim this, I am signing this object:

db:
image: postgres
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=hello_dev
defmodule TBOE.Tasks.LunchBot do
@token "token here"
@channel "#lunch-bot"
@slack_endpoint "https://slack.com/api"
@last_couples_file "/tmp/lunch_last_couples.txt"
@greeting """
Hello @channel :wave:
:point_down: Here are next week's couples! have coffee or lunch anytime next week with the person you've been paired with :hugging_face:
@boudra
boudra / db.js
Last active September 10, 2024 11:55
Using docker-compose for Postgres
const Sequelize = require("sequelize");
const sequelize = new Sequelize("postgres://user:pass@localhost:5432/codeworks");
sequelize.authenticate().then(() => {
console.log("connected to database");
}).catch(() => {
console.error("failed to connect to database");
})