Skip to content

Instantly share code, notes, and snippets.

View bmamouri's full-sized avatar

Baqer Mamouri bmamouri

  • Sydney, NSW, Australia
View GitHub Profile
@bmamouri
bmamouri / getimageinfo.py
Created June 4, 2016 19:17
Source code for getImageInfo function to get the dimension of an image from the header
# 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)
@bmamouri
bmamouri / server_rendering.js
Last active June 7, 2016 01:40
Minimal Server Rendering with ReacJS
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>)
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
This file has been truncated, but you can view the full file.
(window.webpackJsonp = window.webpackJsonp || []).push([
[2], {
"+6xv": function(e, t, n) {
"use strict";
n.d(t, "a", (function() {
return r
})), n.d(t, "b", (function() {
return a
})), n.d(t, "c", (function() {
return i