Skip to content

Instantly share code, notes, and snippets.

View BastinRobin's full-sized avatar
🏠
Working from home

Bastin Robin BastinRobin

🏠
Working from home
View GitHub Profile
@BastinRobin
BastinRobin / Makefile
Created March 10, 2023 13:54 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@BastinRobin
BastinRobin / how-to-squash-commits-in-git.md
Created December 4, 2021 09:29 — forked from patik/how-to-squash-commits-in-git.md
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@BastinRobin
BastinRobin / git-clearHistory
Created January 10, 2020 06:43 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@BastinRobin
BastinRobin / laravel_horizon.md
Created December 24, 2019 16:01 — forked from ankurk91/laravel_horizon.md
Laravel Horizon, redis-server, supervisord on Ubuntu server

Laravel Horizon, redis-server, supervisord on Ubuntu 16/18 server

Laravel 6.0, Horizon 3.x, Redis 5.x

Parepare application

  • Install and configure Laravel Horizon as instructed in docs
  • Make sure you can access the Horizon dashboard like - http://yourapp.com/horizon
  • For now it should show status as inactive on dashbaord

Install redis-server

@BastinRobin
BastinRobin / a.md
Created June 15, 2018 16:08 — forked from danharper/a.md
Laravel Queue Supervisor

Install Supervisor with sudo apt-get install supervisor. Ensure it's started with sudo service supervisor restart.

In /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread. And start using those changes with: sudo supervisorctl update.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@BastinRobin
BastinRobin / stock.py
Created January 16, 2017 17:23 — forked from sanand0/stock.py
Pull currency and stock data
#! /usr/bin/env python
"""
Author: Bastin Robin
"""
import os
import logging
from urllib import urlencode
import datetime
import pandas as pd
@BastinRobin
BastinRobin / gist:0cca0e267408e361062a8681d0cc556d
Created September 28, 2016 16:23 — forked from excalq/gist:2961415
Javacript: Set or Update a URL/QueryString Parameter, and update URL using HTML history.replaceState()
// Explicitly save/update a url parameter using HTML5's replaceState().
function updateQueryStringParam(param, value) {
baseUrl = [location.protocol, '//', location.host, location.pathname].join('');
urlQueryString = document.location.search;
var newParam = key + '=' + value,
params = '?' + newParam;
// If the "search" string exists, then build params from it
if (urlQueryString) {
keyRegex = new RegExp('([\?&])' + key + '[^&]*');
@BastinRobin
BastinRobin / conversion.py
Created September 26, 2016 17:00 — forked from AnnamalaiNagappan/conversion.py
python script to convert all python .py files inside the current directory and all its subdirectories into .pyc and remove all .py files
import compileall
import os
# Get current working directory
curr_dir = os.getcwd()
# Compiles all python files to pyc
compileall.compile_dir(curr_dir, force=True)
# Recursively iterates to find .py files and remove them
@BastinRobin
BastinRobin / index.html
Created July 21, 2016 07:06 — forked from benjchristensen/index.html
Dynamic Stacked Bar Chart using d3.js
<html>
<head>
<title>Dynamic Stacked Bar Chart using d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
rect.a {
fill: green;
}
rect.b {
fill: orange;