Skip to content

Instantly share code, notes, and snippets.

View firdausramlan's full-sized avatar
🎯
Focusing

Firdaus Ramlan firdausramlan

🎯
Focusing
View GitHub Profile
import React from 'react'
import revalidation from 'revalidation'
import gql from 'graphql-tag.macro'
import { filter } from 'graphql-anywhere'
import { curry } from 'ramda'
import { compose, withProps, withHandlers } from 'recompose'
import { graphql } from 'react-apollo'
import { Button } from '../common/styled'
import { getValue } from '../form/utils'
import { isRequired } from '../../utils/validation'

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@firdausramlan
firdausramlan / writeInGithub.js
Created August 12, 2017 12:11 — forked from WebReflection/writeInGithub.js
a silly script to write in your github timeline
/**
* so here the thing ... you go in your github page
* as example I go here: https://github.com/WebReflection
* you open your console
* you copy and paste this shit
* then you write and execute in the console
* write("Hi There!");
* NOTE: Pixel Font from a 2006 project of mine :-) http://devpro.it/pixelfont/
*/
function write(text, color, start) {
@firdausramlan
firdausramlan / nodejs-tcp-example.js
Created January 30, 2017 04:42 — forked from tedmiston/nodejs-tcp-example.js
Node.js tcp client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@firdausramlan
firdausramlan / nginx.conf
Created December 7, 2015 04:34 — forked from dnprock/nginx.conf
meteor nginx load balance with sticky session, used by vida.io
# Sticky session module for nginx
# https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/
# nginx configure command: ./configure --with-http_ssl_module --add-module=../nginx-sticky-module-ng/ --sbin-path=/usr/local/sbin --with-http_gzip_static_module
upstream vida_node_server {
sticky path=/;
server 127.0.0.1:3000 max_fails=3 fail_timeout=30s;
server [server2]:3000 max_fails=3 fail_timeout=30s;
}
@firdausramlan
firdausramlan / meteor-async.md
Created November 14, 2015 19:08 — forked from possibilities/meteor-async.md
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:

@firdausramlan
firdausramlan / generate-pdf.js
Last active September 2, 2015 14:36 — forked from michaltakac/generate-pdf.js
Generating PDF from website screenshot using Iron Router and Webshot
/**
* Generating PDF from website screenshot.
*
* Using iron:router's server-side route and meteorhacks:npm to load Webshot NPM package.
* Don't forget to add "webshot": "0.16.0" to your packages.json file. Example:
* {
* "webshot": "0.16.0"
* }
* Tried it with bryanmorgan:webshot but it didn't work so sticking to loading NPM package directly.
* Thanks to @nate-strauser (https://github.com/nate-strauser).

Source: http://forum.lowyat.net/index.php?showtopic=355950&view=findpost&p=11151482

A few forumers asked me questions regarding reading of MyKad surface information. The answer is there is no encryption; it is just about knowing what (APDU) command to send.

There will be 5 APDU commands that I'll introduce. I name them as:

  • Select Application
  • Get Response
  • Set Length
  • Select Info

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

Keybase proof

I hereby claim:

  • I am firdausramlan on github.
  • I am firdausramlan (https://keybase.io/firdausramlan) on keybase.
  • I have a public key whose fingerprint is EB4B 4608 BD4F 4EDD D39C A1F0 104E 8634 32EF 51C7

To claim this, I am signing this object: