Skip to content

Instantly share code, notes, and snippets.

View aminyuddin's full-sized avatar

Amin Yuddin aminyuddin

  • Kuala Lumpur
View GitHub Profile
@aminyuddin
aminyuddin / makeAnimatedGif.m
Created September 29, 2016 03:36 — forked from mayoff/makeAnimatedGif.m
Example of creating an animated GIF on iOS, with no 3rd-party code required. This should also be easy to port to OS X.
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
static UIImage *frameImage(CGSize size, CGFloat radians) {
UIGraphicsBeginImageContextWithOptions(size, YES, 1); {
[[UIColor whiteColor] setFill];
UIRectFill(CGRectInfinite);
CGContextRef gc = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(gc, size.width / 2, size.height / 2);
@aminyuddin
aminyuddin / program.sh
Created July 27, 2016 03:55
Sometimes, developer need to open few programs in new tab terminal. Use this script to automate.
#!/bin/bash
function tab() {
osascript 2>/dev/null <<EOF
tell application "System Events"
tell process "Terminal" to keystroke "t" using command down
end
tell application "Terminal"
activate
do script with command "$*" in window 0
package com.test.core;
import com.test.enums.ErrorStatus;
public class ApplicationException extends RuntimeException{
/**
*
*/
@aminyuddin
aminyuddin / sql2json.js
Created February 23, 2016 05:19 — forked from martindrapeau/sql2json.js
CSVJSON.com - SQL to JSON function. Can be used in Node.js to run large data sets.
(function() {
/**
*
* CSVJSON.sql2json(sql)
*
* Converts SQL to JSON. Returns an object. Detects CREATE TABLE and INSERT INTO
* statements to extract table header and rows. Use JSON.stringify to conver to a string.
*
* Dependencies:
* - underscore (http://underscorejs.org/)
@aminyuddin
aminyuddin / tmux-cheatsheet.markdown
Created February 18, 2016 03:33 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@aminyuddin
aminyuddin / Shell log.sh
Created February 17, 2016 10:09 — forked from acdha/Shell log.sh
Commands needed to create an AWS RDS database parameter group which defaults to Unicode sanity: UTF-8, full collation, etc.
# Mac Homebrew command to install the RDS command-line tools
# Ubuntu users may find https://launchpad.net/~awstools-dev/+archive/awstools/ useful
brew install rds-command-line-tools
rds-create-db-parameter-group mysql-utf8 -f mysql5.1 -d "MySQL 5.1 configured for UTF-8"
rds-modify-db-parameter-group mysql-utf8 \
--parameters="name=character_set_server, value=utf8, method=immediate" \
--parameters="name=character_set_client, value=utf8, method=immediate" \
--parameters="name=character_set_results, value=utf8, method=immediate" \
Username: admin@local.host
Password: 5iveL!fe
@aminyuddin
aminyuddin / Test
Created September 29, 2014 08:08
Hello, world!
This is gist testing!