Skip to content

Instantly share code, notes, and snippets.

Baqer Mamouri bmamouri

Block or report user

Report or block bmamouri

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View aws command cheatsheet
Creating a key pair:
aws ec2 create-key-pair --key-name read-key --query 'KeyMaterial' --output text
aws ec2 create-security-group --group-name group-name
@bmamouri
bmamouri / server_rendering.js
Last active Jun 7, 2016
Minimal Server Rendering with ReacJS
View server_rendering.js
import {renderToString} from 'react/lib/ReactDOMServer'
import {RouterContext} from 'react-router'
import {Provider} from 'react-redux'
export default (req, res) => {
const componentHTML = renderToString(
<Provider store={store}>
<RouterContext {...renderProps} />
</Provider>)
@bmamouri
bmamouri / getimageinfo.py
Created Jun 4, 2016
Source code for getImageInfo function to get the dimension of an image from the header
View getimageinfo.py
# coding:utf-8
# From http://code.google.com/p/plsamples/source/browse/trunk/GrandMonde/getimageinfo.py
import StringIO
import struct
from reseekfile import ReseekFile
def getImageInfo(datastream):
datastream = ReseekFile.ReseekFile(datastream)
You can’t perform that action at this time.