Skip to content

Instantly share code, notes, and snippets.

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

ahmadhasyim lordhasyim

🏠
Working from home
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
<color name="red_600">#dd191d</color>
<color name="red_700">#d01716</color>
@lordhasyim
lordhasyim / add-apt-repository
Created October 10, 2016 06:11
python ppa kali
#!/bin/bash
if [ $# -eq 1 ]
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
then
ppa_name=`echo "$1" | cut -d":" -f2 -s`
if [ -z "$ppa_name" ]
then
echo "PPA name not found"
echo "Utility to add PPA repositories in your debian machine"
@lordhasyim
lordhasyim / simple-git-flow.sh
Created November 13, 2016 12:53 — forked from bloudermilk/simple-git-flow.sh
A simple git workflow
#
# Starting
#
# Start a new feature branch
git checkout -b my_feature
# Make changes
# Add/Commit
@lordhasyim
lordhasyim / WindowsCommandPromptAsciiArt.txt
Created December 7, 2016 07:30 — forked from mpaxson/WindowsCommandPromptAsciiArt.txt
Windows Command Prompt Ascii Art
:: add this to the cmder/config/user-profile.cmd
::meme intro
:: this is to change starting directory to another drive
::@set USERPROFILE="F:\KettleOfHacks";
::@F:
:: @cd F:\KettleOfHacks\Work
@cls
@echo off
File System
ls — list items in current directory
ls -l — list items in current directory and show in long format to see perimissions, size, and modification date
ls -a — list all items in current directory, including hidden files
ls -F — list all items in current directory and show directories with a slash and executables with a star
@lordhasyim
lordhasyim / CentOS_7.2_New_WebServer_Configuration.txt
Created January 28, 2017 18:45 — forked from alkavan/CentOS_7.x_(PHP_7.3_Postgres_10.x).md
CentOS 7.2 New Web Server Configuration (DigitalOcean) +EPEL +IUS +PHP +MongoDB +Sentry +PostgreSQL +MariaDB
# [General/Initial Section]
# Update system
yum update
# Set your timezone
timedatectl set-timezone UTC
# Check date is set correct
date
@lordhasyim
lordhasyim / multi-select-dropdown
Created February 8, 2017 16:39 — forked from 131digital/multi-select-dropdown
Codeigniter - Populate multi select dropdown from database
<?php
// put in controller
$vendor_categories = $this->vendor_category_model->get_many_by('vendorid',$id);
// get the category the vendor belongs to
$vendorcat = array();
foreach($vendor_categories as $vendor_category => $value){
$vendorcat[$value->categoryid] = $value->categoryid;
}
//data array for view
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
.DS_Store
application/cache/*
!application/cache/index.html
!application/cache/.htaccess
application/logs/*
!application/logs/index.html
!application/logs/.htaccess
@lordhasyim
lordhasyim / php
Created March 15, 2017 08:02
REST API Upload using native CI Upload class.
/**
* REST API Upload using native CI Upload class.
* @param userfile - multipart/form-data file
* @param submit - must be non-null value.
* @return upload data array || error string
*/
function upload_post(){
if( ! $this->post('submit')) {
$this->response(NULL, 400);
}