View simple-elixir-server.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mix.install([{:plug_cowboy, "~> 2.0"}]) | |
defmodule Server do | |
use Plug.Router | |
plug(:match) | |
plug(:dispatch) | |
match _ do | |
send_resp(conn, 200, "Hello World!") | |
end |
View gmail-recruiter-reply.appscript.js.gs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function respondToEmails() { | |
//var filter = 'from:(some.email@address.com) AND -label:"Auto-Replied"'; | |
var filter = 'label:"Job Proposals" AND -label:"Auto-Replied"'; | |
var completeLabel = GmailApp.getUserLabelByName("Auto-Replied"); | |
var threads = GmailApp.search(filter); | |
var replyFrom = "Recruiter Bot <your.email+recruiterbot@gmail.com>"; | |
val realEmail = "your.real@email.com" | |
var formLink = "https://link.to/your/form" | |
var response = ( |
View localdev.nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dev Local Conf for multiple subdomain websites | |
# Here `appdev.com` is pointing to 127.0.0.1 | |
#resolver 127.0.0.11 valid=5s; # for docker | |
ssl_certificate /usr/local/etc/nginx/ssl/app.server.crt; | |
ssl_certificate_key /usr/local/etc/nginx/ssl/app.server.key; | |
upstream app_backend { server localhost:4000; } | |
upstream app_website { server localhost:5001; } |
View twitter_deleter.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule TwitterDeleter do | |
@tweet_data Path.expand("~/Downloads/twitterdump/assets/tweet.js") | |
@cutoff Date.from_iso8601!("2015-01-01") | |
@call_limit 3000 | |
@chunk_no 3 | |
require Logger | |
def run do | |
file = File.read!(@tweet_data) |
View .dockerignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Elixir Artifacts | |
/_build/ | |
/deps/ | |
/doc/ | |
/cover/ | |
/.fetch | |
*.ez | |
APPNAME-*.tar | |
erl_crash.dump |
View simple-elixir-app.dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build the release | |
# ----------------- | |
FROM elixir:1.9.0-alpine as build | |
ENV MIX_ENV=prod | |
WORKDIR /source | |
RUN mix local.hex --force && mix local.rebar --force | |
# Cache dependencies |
View app-context.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Custom Implementation of React Context to manage | |
* global application state | |
* | |
* @author Sheharyar Naseer (@sheharyarn) | |
* @license MIT | |
* | |
* Normal Usage: | |
* | |
* ``` |
View flatten.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Flatten do | |
@doc """ | |
Flattens a List in Elixir | |
## Examples | |
``` | |
Flatten.flatten([1,2,3,4]) | |
# => [1,2,3,4] |
View memoize.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Memoize do | |
@moduledoc """ | |
Simple memoization helper built on top of FastGlobal. | |
Remember to add `{:fastglobal, "~> 1.0"}` to your | |
dependencies first. | |
## Usage |
View reddup_video_controls.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Reddup Video Controls | |
// @version 0.1.0 | |
// @namespace https://www.reddup.co/ | |
// @homepageURL https://sheharyar.me/ | |
// @author Sheharyar Naseer | |
// @description Show Video Controls for all videos on Reddup | |
// @include http*://www.reddup.co/* | |
// @license MIT | |
// ==/UserScript== |
NewerOlder