Skip to content

Instantly share code, notes, and snippets.

View BastinRobin's full-sized avatar
🔬
Trying Odd's on daily basis ;)

Bastin Robin BastinRobin

🔬
Trying Odd's on daily basis ;)
View GitHub Profile
find . -name '*.php' -not -path "./vendor/*" | xargs wc -l
@BastinRobin
BastinRobin / lang.jz
Created May 20, 2020 06:34
Javiz Syntax
from utensils take container
from groceries take milk
now:
assign a with 100
assign b with 200
see a > b:
tell("I am bigger")
@BastinRobin
BastinRobin / date.py
Created February 8, 2020 12:45
Dates Between Two Days
from datetime import datetime, timedelta
d1 = datetime.strptime('2020-12-01', '%Y-%m-%d')
d2 = datetime.strptime('2021-12-01', '%Y-%m-%d')
def date_between(start, end):
"""
Returns list of all dates between given `start and end`
@BastinRobin
BastinRobin / git.sh
Created January 23, 2020 07:23
Git Shortcuts
# ----------------------
# Git Aliases
# ----------------------
alias ga='git add'
alias gaa='git add .'
alias gaaa='git add --all'
alias gau='git add --update'
alias gb='git branch'
alias gbd='git branch --delete '
alias gc='git commit'
@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 / fib.py
Last active November 18, 2019 06:24
Optimal Fibonnaci
# Recursion Method
# O(2n) Time | O(n) Space Complexity
def getFib(n):
if n == 1:
return 0
if n == 2:
return 1
return getFib(n-1) + getFib(n-2)
# Recursion with cache method
@BastinRobin
BastinRobin / sparx.js
Created September 10, 2019 17:29
Sprax.js Draft
$(function() {
window.sparx = window.sparx || {};
window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
window.addEventListener('online', updateSparxNetwork);
window.addEventListener('offline', updateSparxNetworkOffline);
sparx.check = {
is_online: true
};
@BastinRobin
BastinRobin / Subdomain nginx
Created September 10, 2019 15:25
Nginx Subdomain
# Expires map
map $sent_http_content_type $expires {
default off;
text/html epoch;
text/css max;
application/javascript max;
~image/ max;
}
server {
@BastinRobin
BastinRobin / SQL.py
Created September 8, 2019 11:52
Eloquent
# Insert
if request.method == 'POST':
user = User(
fname=request.form['fname'],
lname=request.form['lname']
)