Skip to content

Instantly share code, notes, and snippets.

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

Sumardi Shukor sumardi

🏠
Working from home
View GitHub Profile
@sumardi
sumardi / nginx.default.conf
Last active November 2, 2024 14:29
Install PHP-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 PHP-FPM
sudo yum install -y nginx php-fpm
# Install PHP extensions
sudo yum install -y php-devel php-mysql php-pdo \
php-pear php-mbstring php-cli php-odbc \
@sumardi
sumardi / gist:4729538
Created February 7, 2013 08:40
One line browser notepad
data:text/html, <html contenteditable>
data:text/html;charset=utf-8, <title>TextEditor</title> <link rel="shortcut icon" href="http://g.etfv.co/https://docs.google.com"/> <style> html{height: 100%;} body{background: -webkit-linear-gradient(#f0f0f0, #fff); padding: 3%; height: 94%;} .paper { font: normal 12px/1.5 "Lucida Grande", arial, sans-serif; width: 50%; height: 80%; margin: 0 auto; padding: 6px 5px 4px 42px; position: relative; color: #444; line-height: 20px; border: 1px solid #d2d2d2; background: #fff; background: -webkit-gradient(linear, 0 0, 0 100%, from(#d9eaf3), color-stop(4%, #fff)) 0 4px; background: -webkit-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -moz-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -ms-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -o-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; -webkit-background-size: 100% 20px; -moz-background-size: 100% 20px; -ms-background-size: 100% 20px; -o-background-size: 100% 20p
@sumardi
sumardi / gist:4693510
Created February 1, 2013 19:33
Currency format.
NSNumberFormatter *currencyFormatter = [[NSNumberFormatter alloc] init];
[currencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
NSLog(@"%@", [currencyFormatter stringFromNumber:[NSNumber numberWithInt:10395209]]);
[currencyFormatter release];
@sumardi
sumardi / style.css
Created January 18, 2013 11:14
Preventing body from scrolling when a bootstrap modal is opened.
body.modal-open {
overflow: hidden;
}
@sumardi
sumardi / Default (OSX).sublime-keymap
Created January 17, 2013 13:46
Reindent Text in Sublime : Add the following line to your user keybindings. Preferences → Key Bindings – User
[
{ "keys": ["ctrl+z"], "command": "reindent", "args": {"single_line": false} }
]
@sumardi
sumardi / vacancies.md
Last active March 3, 2023 22:41
I'm hiring Web and Android Application Developer. (Fulltime position)

1. Web Application Developer

You’re brilliant, we’re hiring. Pretty simple, right? Well, kinda.

About Us

  • We are a small startup with a big idea and based in Cyberjaya, Malaysia.
  • Our team is made up of young, passionate personalities built around a enthusiasm to be the best.
  • We are not big on employee handbooks. Wear jeans or a t-shirt on most days – we don’t care. But, there will be occasions when you need to represent the company with class.
  • Our development projects are typically built on PHP (the LAMP stack) and are often using Laravel. You don’t need to know those to join our team, as long as you’re experienced with another MVC framework (such as CakePHP, Codeigniter or Zend).
@sumardi
sumardi / .gitconfig
Last active December 10, 2015 13:38
git alias
[alias]
ignored = !git ls-files -v | grep ^[a-z]
ignore = update-index --assume-unchanged
unignore = update-index --no-assume-unchanged
alias = "!git config -l|awk -F= '/^alias/ { sub(\"^alias\\.\", \"\", $1); print $1 \"\t\" $2 }'"
update_sub = 'git pull --recurse-submodules && git submodule update'
// http://cocoawithlove.com/2009/10/ugly-side-of-blocks-explicit.html has a nice breakdown of the syntax--it helps to think of the ^ as similar to a pointer dereference symbol *
// block typedef:
typedef void(^Block)();
typedef void(^ConditionalBlock)(BOOL);
typedef NSString*(^BlockThatReturnsString)();
typedef NSString*(^ConditionalBlockThatReturnsString)(BOOL);
// block property with typedef:
@sumardi
sumardi / gist:4377790
Created December 26, 2012 04:13
TCC Authentication API Call using RestKit
RKObjectManager *manager = [RKObjectManager managerWithBaseURL:[NSURL URLWithString:@"http://refapi.thecurrencycloud.com"]];
// Response Mapping
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[TCC class]];
[mapping addAttributeMappingsFromDictionary:@{@"status" : @"status", @"data" : @"token", @"message" : @"message"}];
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil statusCodes:nil];
[manager addResponseDescriptor:responseDescriptor];
// Request Mapping
RKObjectMapping *requestMapping = [RKObjectMapping requestMapping];