Skip to content

Instantly share code, notes, and snippets.

View lukrizal's full-sized avatar

Luk Rizal lukrizal

  • Manila City, Philippines
View GitHub Profile
@lukrizal
lukrizal / cloudSettings
Last active October 27, 2020 05:46
Linux Scripting
{"lastUpload":"2020-10-27T05:46:05.454Z","extensionVersion":"v3.4.3"}
@lukrizal
lukrizal / remove old kernels
Last active August 22, 2016 09:42
Update CentOS
yum install yum-utils
package-cleanup --oldkernels --count=2
#!/usr/bin/env bash
yum update
curl -fsSL https://get.docker.com/ | sh
service docker start
groupadd docker
useradd web
usermod -aG docker root
usermod -aG docker web
@lukrizal
lukrizal / index.js
Created May 2, 2016 07:08
get all urls defined on a project
var routes = [];
var fs = require('fs-extra');
var path = require('path');
var _ = require('underscore');
var json2csv = require('json2csv');
var filesToScan = [
process.cwd() + '/index.php'
];
var jsdom = require("jsdom");
var directoriesToScan = [
@lukrizal
lukrizal / all.sh
Last active September 19, 2019 10:39
#!/bin/bash
echo "Downloading GetDeb and PlayDeb" &&
wget http://archive.getdeb.net/install_deb/getdeb-repository_0.1-1~getdeb1_all.deb http://archive.getdeb.net/install_deb/playdeb_0.3-1~getdeb1_all.deb
echo "Installing GetDeb" &&
sudo dpkg -i getdeb-repository_0.1-1~getdeb1_all.deb
echo "Installing PlayDeb" &&
sudo dpkg -i playdeb_0.3-1~getdeb1_all.deb &&
> vendor should be in ignored list
> use .env of laravel, that is better than directly putting sensitive details in database.php configuration file
> .env should be ignored from the ignored list
> Eloquent of is better than using DB, in terms of scalability
> Use of foreign keys is a must
> Use Route::resource or Route::controller than using Route::get for related routes.
> composer.json should specify the supported php version
> avoid ambiguous-related of naming of classes
> when using Frameworks or related things like it, as much as possible align with their coding standard to maximize their usage.
var gulp = require('gulp'),
compile = require('./node_modules/laravel-elixir/tasks/shared/Css.js'),
Elixir = require('laravel-elixir'),
Log = Elixir.Log,
fs = require('fs'),
path = require('path'),
config = Elixir.config;
/*
|----------------------------------------------------------------
@lukrizal
lukrizal / osx-10.10-setup.md
Created December 9, 2015 04:20 — forked from kevinelliott/osx-10.10-setup.md
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@lukrizal
lukrizal / web | api
Created September 2, 2015 05:24
some things that programmer usually trying to solve
> just use the "resource" concept.
> make use of hashed_id rather than exposing the real id.
> throw exceptions rather than doing manual error returns.
> always use general usage, "result", "code", "data" as first level indeces of the response.
> always use general query words for distinguishing special actions or request.
> "action" to state what action to be done other than the main action verbs(update(PUT), destroy(DELETE), create(POST), show(GET), list(GET).
> always use jsonp
> be general(in layman's term) in describing messages. if specific description is needed better represent it with a error/message code that linked on a exclusive page only accessible by authorized person that needs it.
> use events/queuing rather than executing directly the process on each request.
> use websockets as much as possible for polling.
app.directive 'paymentMethod', ()->
restrict: "AE"
templateUrl: 'directive-payment'
scope:
onImage : '=on'
offImage : '=off'
value : '=value'
text : '=text'
require: 'ngModel'
link: ($scope, $elem, $attrs, ngModel)->