Skip to content

Instantly share code, notes, and snippets.

@mkhuramj
mkhuramj / install-segoeui-fonts.sh
Created January 1, 2025 11:07 — forked from habernal/install-segoeui-fonts.sh
Install MS Segoe UI fonts on Ubuntu
#!/bin/bash
# We install the fonts locally, not into /usr/share/fonts/truetype to avoid unnecessary sudo rights
DEST_DIR="${HOME}/.fonts/segoeui"
mkdir -p $DEST_DIR
# Download 15 *.ttf files
VARIANTS='segoeui segoeuib segoeuii segoeuiz segoeuil seguili segoeuisl seguisli seguisb seguisbi seguibl seguibli seguiemj seguisym seguihis'
for VARIANT in $VARIANTS; do
@mkhuramj
mkhuramj / README.md
Created November 2, 2021 06:32 — forked from brunogaspar/README.md
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Installation

#!/bin/bash
# What it is: a script to compile and install Nginx manually in Ubuntu 14.04 server
# Author: Pothi Kalimuthu
# Author URL: http://pothi.info
# License: GPL v2
### VARIABLES ###
# Please know that this script should be executed as normal user with __sudo__ privileges.
@mkhuramj
mkhuramj / nginx.default.conf
Created August 13, 2016 19:43 — forked from santoshachari/nginx.default.conf
PHP5.6 and NGINX: Install PHP56-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and php56-FPM
sudo yum install -y nginx php56-fpm
# Install php56 extensions
sudo yum install -y php56-devel php-mysql php56-pdo php56-pear php56-mbstring php56-cli php56-odbc php56-imap php56-gd php56-xml php56-soap
@mkhuramj
mkhuramj / 1_phpunit-api.md
Created April 18, 2016 05:55 — forked from loonies/1_phpunit-api.md
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this->anything()
@mkhuramj
mkhuramj / 0_reuse_code.js
Created April 12, 2016 06:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mkhuramj
mkhuramj / gist:6ab093400f97bcd7d2b0
Created March 28, 2016 15:48 — forked from JasonMortonNZ/gist:5499511
Laravel S3 image uploader
// Routes.php
Route::get('upload', function()
{
return View::make('upload-form');
});
Route::post('upload', function()
{
// Get and move uploaded file.
@mkhuramj
mkhuramj / add-option-to-dropdown.js
Created January 21, 2016 11:04 — forked from paulund/add-option-to-dropdown.js
Add and Remove Options in Select using jQuery
$("#selectBox").append('<option value="option6">option6</option>');
@mkhuramj
mkhuramj / README.md
Created December 6, 2015 09:51 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@mkhuramj
mkhuramj / gist:c8d6768f97492e5c22ae
Created December 3, 2015 12:17 — forked from adamfairholm/gist:af88caf5bd0e585154ed
Laravel's where date functions.
<?php
// Laravel has some date functions in the query builder that I never really
// see mentioned. Most of the time when a user needs to do a MONTH(col) select,
// they are advised to do something like this:
$employees = Employee::where(DB::Raw('MONTH(hired_at)'), '=', 4)->get();
// However, Laravel seems to have query builder functions that take care of this.
// The above query could be rewritten as:
$employees = Employee::whereMonth('hired_at', '=', 4)->get();