Skip to content

Instantly share code, notes, and snippets.

Avatar

Praveen Perera praveenperera

View GitHub Profile
@praveenperera
praveenperera / Dockerfile
Created Jun 25, 2020
Dockerfile for my phoenix + tailwindcss + purge css template repo
View Dockerfile
# STEP 1 - DEPS GETTER
FROM hexpm/elixir:1.10.2-erlang-22.2.7-alpine-3.11.3 AS deps-getter
# setup up variables
ARG APP_NAME
ARG APP_VSN
ARG PHOENIX_SUBDIR=.
ENV APP_NAME=${APP_NAME} \
APP_VSN=${APP_VSN}
@praveenperera
praveenperera / utils.rs
Last active May 27, 2020
build a path list in parallel
View utils.rs
use crossbeam_channel as channel;
use ignore::WalkBuilder;
use std::path::{Path, PathBuf};
#[derive(Debug)]
enum Message {
FoundPath(Result<ignore::DirEntry, ignore::Error>),
DoneScanning,
}
View install.sh
#!/bin/bash
# Options
#
# -V, --verbose
# Enable verbose output for the installer
#
# -f, -y, --force, --yes
# Skip the confirmation prompt during installation
#
View brew_permissions.sh
sudo chown -R $(whoami) /usr/local
sudo chown -R $(whoami) $(brew --prefix)/*
sudo chown -R "$USER":admin /usr/local
sudo chown -R "$USER":admin /Library/Caches/Homebrew
@praveenperera
praveenperera / webpack.config.js
Created Dec 17, 2019
webpack.config.js (2019)
View webpack.config.js
const path = require("path");
const glob = require("glob");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const WebpackNotifierPlugin = require("webpack-notifier");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const isProduction = process.env.NODE_ENV === "production";
const ImageminPlugin = require("imagemin-webpack-plugin").default;
@praveenperera
praveenperera / crate-gh-install.sh
Last active Nov 27, 2019 — forked from sjparkinson/crate-gh-install.sh
Install binaries from a GitHub release.
View crate-gh-install.sh
#!/bin/sh
# Heavily modified from https://github.com/japaric/trust/blob/gh-pages/install.sh.
help() {
cat <<'EOF'
Install a binary release of a Rust crate hosted on GitHub.
Usage:
install.sh [options]
@praveenperera
praveenperera / prod_issuer.yaml
Created Sep 24, 2019
cluster issuer foor route53
View prod_issuer.yaml
apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
email: your_email@gmail.com
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
name: letsencrypt-prod
View keybase.md

Keybase proof

I hereby claim:

  • I am praveenperera on github.
  • I am praveenperera (https://keybase.io/praveenperera) on keybase.
  • I have a public key ASA7gaHjs_VF4UG15CNroeYzQhJ-Zy28Vr7Nt5agSPK8pAo

To claim this, I am signing this object:

View gist:6ad456936350bc6f43450265ea4a1cb0
#!/usr/bin/perl -w
# -*- Mode: CPerl -*-
#
# This code was developped by IDEALX (http://IDEALX.org/) and
# contributors (their names can be found in the CONTRIBUTORS file).
# Copyright (C) 2000-2004 IDEALX
# Copyright (C) 2005-2011 Nicolas Niclausse
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@praveenperera
praveenperera / parser.js
Created Sep 11, 2018 — forked from rusty-key/parser.js
PropTypes → BS
View parser.js
const fs = require('fs')
const path = require('path')
const definedTypes = {
'PropTypes.string': 'string',
'PropTypes.bool': 'bool',
}
const files = fs.readdirSync('src')
.filter(file => file[0] === file[0].toUpperCase() && file[0] !== '_')
You can’t perform that action at this time.