Skip to content

Instantly share code, notes, and snippets.

View abitdodgy's full-sized avatar
😃
Out to lunch!

Mohamad El-Husseini abitdodgy

😃
Out to lunch!
View GitHub Profile
@joshnuss
joshnuss / udp_server.exs
Last active October 9, 2023 09:11
Fault tolerant UDP Server in Elixir
# to run:
# > elixir --no-halt udp_server.exs
# to test:
# > echo "hello world" | nc -u -w0 localhost 2052
# > echo "quit" | nc -u -w0 localhost 2052
# Let's call our module "UDPServer"
defmodule UDPServer do
# Our module is going to use the DSL (Domain Specific Language) for Gen(eric) Servers
use GenServer
@mbenatti
mbenatti / 0-font-awesome-bootstap-phoenix.md
Last active February 2, 2024 14:59
Installing Bootstrap 4 + Font Awesome from NPM in Phoenix Framework using sass
  • Tested with Phoenix 1.3

1) Installing sass, font-awesome and bootstrap package's using Brunch

First, install the Sass, Font Awesome, bootstrap(and deps) package:

cd assets

  • npm install --save-dev sass-brunch
  • npm install --save font-awesome
@jlauemoeller
jlauemoeller / phoenix-and-vue-with-brunch.md
Last active July 14, 2020 21:25
Setting up a Basic Phoenix+Vue+Brunch project

Work in Progress: Phoenix + Vue + Brunch

This documents how I integrate Vue 2.0 with Phoenix 1.x using the default brunch pipeline.

The toolchain

Start out by adding the vue-brunch plugin. You will need a version later than 1.2.3 in order to be able to use the extractCSS option (see later). At the time of writing, 1.2.3 was still the version fetched by npm so I suggest just getting the tip of the dev branch for now (this branch is for Vue 2.0 compatibility anyway):

npm install git+https://github.com/nblackburn/vue-brunch.git#dev --save-dev
@prog1dev
prog1dev / gist:62660be194ce4aec73721a0af1665983
Last active April 29, 2020 12:48
download_zip method without temp files
def download_zip(image_list)
unless image_list.blank?
file_name = 'pictures.zip'
stringio = Zip::ZipOutputStream::write_buffer do |z|
image_list.each do |img|
title = img.title
title += '.jpg' unless title.end_with?('.jpg')
z.put_next_entry(title)
@h0lyalg0rithm
h0lyalg0rithm / daterange.ex
Created September 29, 2016 20:53
Postgres date range type using ecto
defmodule LocationService.Daterange do
@behaviour Ecto.Type
def type, do: :daterange
def cast([lower, upper]) do
{:ok, [lower, upper]}
end
def cast(_), do: :error
@DerekCaelin
DerekCaelin / gist:fb13d85e4bcd503217cc5793c27dfc08
Last active November 30, 2022 18:13
Google Form to Trello Board via Email
/*
If you want entries on a Google form to auto-create a Trello card,
you can follow the steps below.
There are two ways to connect a Google form to a Trello board. One of them
involves using the Trello API. This version instead works by sending an email to a
Trello board's private email address and then it creates cards based off the content
of the email.
Trello will make a card with a title that matches the "subject" line of the
@raysegantii
raysegantii / README.md
Last active June 3, 2020 21:24 — forked from scrogson/README
Use bootstrap-sass npm package with Phoenix's brunch
  1. install npm packages
  2. update brunch-config.js
  3. rename web/static/css/app.css to web/static/css/app.scss
  4. update web/static/css/app.scss
@mdang
mdang / TECHNICAL_INTERVIEW_PRACTICE.md
Last active March 20, 2018 02:52
Technical Interview Practice

Technical Interview Practice

Behavioral and Informational Questions

Along with deciphering if applicants have the right experience, hiring managers also have to determine if they fit well with the team culturally.

  • Tell me something that's a challenge for you
    • This is a spin on the traditional “what’s your biggest weakness” question, and should be answered carefully. A successful answer demonstrates both self-awareness (where you are challenged) and action (how you are taking steps to improve). A word of caution: don’t respond with a “knock-out” answer that would automatically disqualify you for the job. For example, don’t say you don’t like working in teams in an interview for a leadership position or where performing as part of a team is critical.
  • What tech-related blogs, podcasts, newsletters, etc do you read?
  • Describe a time when you were faced with a stressful situation that demonstrated your coping skills.
@noelvo
noelvo / download-multiple-files.js
Created December 6, 2015 23:22
Download multiple files then compress to one zip file using JSZip & JSZip-utils
var zip = new JSZip();
var count = 0;
var zipFilename = "zipFilename.zip";
var urls = [
'http://image-url-1',
'http://image-url-2',
'http://image-url-3'
];
urls.forEach(function(url){
anonymous
anonymous / my.css
Created October 17, 2015 22:49
CSS Gradient Animation
background: linear-gradient(270deg, #28b691, #d0b93c);
background-size: 400% 400%;
-webkit-animation: AnimationName 33s ease infinite;
-moz-animation: AnimationName 33s ease infinite;
-o-animation: AnimationName 33s ease infinite;
animation: AnimationName 33s ease infinite;
@-webkit-keyframes AnimationName {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}