Skip to content

Instantly share code, notes, and snippets.

View aindong's full-sized avatar
🎯
Focusing

Alleo Indong aindong

🎯
Focusing
View GitHub Profile
@aindong
aindong / draw_box
Created August 18, 2017 10:17
draw target like graphics on face
cv2.line(Image, (x, y), (x + (w/5) ,y), WHITE, 2)
cv2.line(Image, (x+((w/5)*4), y), (x+w, y), WHITE, 2)
cv2.line(Image, (x, y), (x, y+(h/5)), WHITE, 2)
cv2.line(Image, (x+w, y), (x+w, y+(h/5)), WHITE, 2)
cv2.line(Image, (x, (y+(h/5*4))), (x, y+h), WHITE, 2)
cv2.line(Image, (x, (y+h)), (x + (w/5) ,y+h), WHITE, 2)
cv2.line(Image, (x+((w/5)*4), y+h), (x + w, y + h), WHITE, 2)
cv2.line(Image, (x+w, (y+(h/5*4))), (x+w, y+h), WHITE, 2)
@aindong
aindong / laravel-permission.sh
Created October 10, 2017 17:10
normalize laravel permission for security and fixing logging issues of permission denied
#!/bin/bash
## create user group
sudo groupadd laravel
## add current user to group
sudo usermod -a -G www-data $USER
## add web server to group
sudo usermod -a -G www-data laravel
@aindong
aindong / line-break.css
Created October 12, 2017 08:46
line break on print media css
@media print {
.break {page-break-after: always;}
}
@aindong
aindong / PolylineAnimation.js
Last active January 25, 2018 08:32
Google Map Polyline animation
let gpsPath = []
let step = 0
let stepIncrement = 1
let numSteps = locations.length - 1
let timePerStep = 300
let interval = setInterval(() => {
step += stepIncrement
if (step >= numSteps) {
@aindong
aindong / magic_square.py
Created March 3, 2018 15:10
My dirty solution to magic square problem
import argparse
from math import floor
def main():
parser = argparse.ArgumentParser()
parser.add_argument("size", help="The size of the square. Please only input odd numbers")
args = parser.parse_args()
size = int(args.size)
@aindong
aindong / provision.sh
Last active June 13, 2019 12:57
provision laravel server with nginx, php, awscli, composer, node, ruby, python
#!/bin/bash
# Add Ruby2.0 respository
add-apt-repository -y ppa:brightbox/ruby-ng-experimental
# Add PHP 7.* ppa
sudo add-apt-repository ppa:ondrej/php
# Add node source respository
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
@aindong
aindong / gist:29910e4e9f5486c40515e14ee1c3a876
Created March 20, 2018 10:19
laravel-folder permission
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
@aindong
aindong / APIService.java
Created March 27, 2018 11:56
Sample response
@GET("/v1/categories")
void getMessages(Callback<BaseResponse<CategoriesResponse>> callback);
@aindong
aindong / AppStoryboard.swift
Created May 1, 2018 14:54 — forked from Gurdeep0602/AppStoryboard.swift
AppStoryboard enumeration
//
// AppStoryboards.swift
// AppStoryboards
//
// Created by Gurdeep on 15/12/16.
// Copyright © 2016 Gurdeep. All rights reserved.
//
import Foundation
import UIKit
@aindong
aindong / GetQueryString.js
Created May 6, 2018 16:36
Get the query string from url using javascript es6
var qs = (function(a) {
if (a == "") return {};
var b = {};
for (var i = 0; i < a.length; ++i)
{
var p=a[i].split('=', 2);
if (p.length == 1)
b[p[0]] = "";
else
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));