Skip to content

Instantly share code, notes, and snippets.

View ichadhr's full-sized avatar
Focusing

Chad ichadhr

Focusing
View GitHub Profile
@ichadhr
ichadhr / README.md
Last active November 7, 2023 02:32
Unblock kumpulbagi

unblock kumpul bagi

Tambahkan alamat IP dan nama domain dibawah ke file hosts

@ichadhr
ichadhr / config.md
Last active February 19, 2017 19:15
Multiple CI

Setting up one codeigniter for multiple site:

example root folder: /home/myweb/public_html/

to keep it nice and tidy

/home/myweb/ci [all codeigniter files]

/home/myweb/ci/system [codeigniter system folder & sub-folder]

@ichadhr
ichadhr / clean-log.sh
Created November 10, 2016 11:16
Cleaning Log
#!/bin/bash
echo "Deleting log file"
sudo -s -- <<EOF
find /var/log -type f -regex ".*\.gz$" -delete
find /var/log -type f -regex ".*\.[0-9]$" -delete
echo "Done."
EOF
exit
@ichadhr
ichadhr / cleanup.sh
Last active November 10, 2016 11:20
Vagrant Box CleanUp
#!/bin/bash
echo "Make user as root"
sudo -s -- <<EOF
echo "Clean system cache.."
apt-get clean
apt-get autoclean
apt-get autoremove
echo "Reducing final box"
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
@ichadhr
ichadhr / Disable_Enable.md
Last active March 25, 2025 21:32
Disable/Enable Hyper-V and VT-X

If you run bcdedit with no arguments, you should see a property called hypervisorlaunchtype. This will be set to off or auto.

To disable Hyper-V in order to use VirtualBox, open a command prompt as administrator and run the command:

bcdedit /set hypervisorlaunchtype off

You’ll need to reboot, but then you’ll be all set to run VirtualBox. To turn Hyper-V back on, run:

bcdedit /set hypervisorlaunchtype auto
@ichadhr
ichadhr / Atitude.md
Created November 3, 2016 06:46
Attitude

#IF A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

#EQUALS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

#THEN K + N + O + W + L + E +D + G + E 11 + 14 + 15 + 23 + 12 + 5 + 4 + 7 + 5 = 96%

@ichadhr
ichadhr / smoothscroll.js
Created March 15, 2016 07:33
Simple smooth scroll Javascript
// Smoothscroll
function ssc_init() {
if (!document.body) return;
var e = document.body;
var t = document.documentElement;
var n = window.innerHeight;
var r = e.scrollHeight;
ssc_root = document.compatMode.indexOf("CSS") >= 0 ? t : e;
ssc_activeElement = e;
ssc_initdone = true;
@ichadhr
ichadhr / jekyll-post-thor.md
Last active April 30, 2025 07:33
Jekyll create post with command

CREATE JEKYLL POSTS FROM THE COMMAND LINE

I got tired on creating new files manually for each new post a write so I put together this little command line task with Thor.

It creates a new file in the _posts directory with today’s date, parses the parameters to command as the post’s title and adds that as a slug to the new file. It then writes a default yaml template to the file (as specified in the script).

Running thor jekyll:new New and shiny post will for example create the file _posts/2012-12-28-new-and-shiny-post.markdown, populate it with an yaml template and finally open the file in my favorite editor.

HOW TO

Add the following to your Gemfile:

#!/usr/bin/env bash
#
# Originally from https://gist.github.com/IanVaughan/2902499
#
# authors: Ian Vaughan
# Jacob Zimmerman
#
# usage: uninstall_gems [<version> ...]
#
# examples:
@ichadhr
ichadhr / url_to_drive.js
Created December 15, 2015 16:44 — forked from denilsonsa/url_to_drive.js
Google Apps Script to upload a file from an URL directly to Google Drive.
// url_to_drive.gs
// Google Apps Script
// Allows uploading a URL directly to Google Drive.
//
// Live link:
// https://script.google.com/macros/s/AKfycbzvhbHS4hnWPVBDHjQzZHA0qWq0GR-6hY7TbYsNto6hZ0MeAFZt/exec
//
// Source-code:
// https://gist.github.com/denilsonsa/8134679
// https://script.google.com/d/1Ye-OEn1bDPcmeKSe4gb0YSK83RPMc4sZJt79SRt-GRY653gm2qVUptoE/edit