Skip to content

Instantly share code, notes, and snippets.

View isogram's full-sized avatar
🙊

Muhammad Shidiq isogram

🙊
View GitHub Profile
@isogram
isogram / ubuntu-server.md
Last active March 3, 2025 15:02
Setup ubuntu server from scratch
@isogram
isogram / zsh.md
Created June 10, 2016 23:38 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@isogram
isogram / week_to_date.sql
Created May 13, 2016 10:29
Get Date Range From Week Number
select
STR_TO_DATE(concat(tgl, ' Monday'),'%x%v %W') date_start,
STR_TO_DATE(concat(tgl, ' Sunday'),'%x%v %W') date_end
from
(
select
date_format(updated_at, "%Y%v") as tgl,
count(1) as counter
from table
group by tgl
@isogram
isogram / wkhtmltopdf_wkhtmltoimage.md
Created April 8, 2016 09:50
How to manually install Wktohtmlpdf and Wkhtmltoimage in Ubuntu Server

How to Install Wkhtmltopdf and Wkhtmltoimage in Ubuntu

wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
tar -xvf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
cd wkhtmltox/bin/
sudo mv wkhtmltopdf  /usr/bin/wkhtmltopdf
sudo mv wkhtmltoimage  /usr/bin/wkhtmltoimage
@isogram
isogram / app_service_provider.md
Created April 1, 2016 14:50
AppServiceProvider Laravel 5.1 Not Firing

Fix AppServiceProvider Laravel 5.1 not firing

  1. php artisan clear-compiled
  2. Delete file service.json in bootstrap/cache
  3. Change $defer property to false
  4. Check AppServiceProvider, is it working now?
  5. Change back $defer to true again
@isogram
isogram / aria2c.md
Created February 13, 2016 19:26
aria2c command sample

Multiple torrent file download and sent it to background process

aria2c -j5 --max-upload-limit=2K file_1.torrent file_2.torrent file_3.torrent file_4.torrent file_5.torrent > aria2c.log 2>&1 &

@isogram
isogram / jquery.parseparams.js
Created January 11, 2016 10:34 — forked from kares/jquery.parseparams.js
jQuery.parseParams - parse query string paramaters into an object
/**
* $.parseParams - parse query string paramaters into an object.
*/
(function($) {
var re = /([^&=]+)=?([^&]*)/g;
var decodeRE = /\+/g; // Regex for replacing addition symbol with a space
var decode = function (str) {return decodeURIComponent( str.replace(decodeRE, " ") );};
$.parseParams = function(query) {
var params = {}, e;
while ( e = re.exec(query) ) {
@isogram
isogram / update_mysql_5.5_to_5.6.md
Created December 21, 2015 09:44
Update MySQL version from 5.5 to 5.6 on Ubuntu Server

step 1 : take a backup

mysqldump --lock-all-tables -u root -p --all-databases > dump.sql

step 2 : remove old mysql

sudo apt-get remove mysql-server
sudo apt-get autoremove
@isogram
isogram / playstore_crawler.php
Created October 7, 2015 10:52
Playstore Crawler PHP using Symfony/DomCrawler and GuzzleHttp
<?php
use Cache; // alias from laravel
use Symfony\Component\DomCrawler\Crawler;
use GuzzleHttp\Client;
public function parsePlayStore($url='')
{
$parsedUrl = parse_url($url, PHP_URL_QUERY);
$packageNameFromUrl = 'com.inponsel.android';

Image Processing with ImageMagick

  • Resize and crop with mogrify
    mogrify /path/to/folder/ -format jpg -resize "64x64^" -gravity center -crop 64x64+0+0 +repage *.jpg
    mogrify /path/tp/folder/ -format jpg -thumbnail 64x64^ -gravity center -extent 64x64 *.*