Skip to content

Instantly share code, notes, and snippets.

View aamnah's full-sized avatar
💭
the learning never stops

Aamnah aamnah

💭
the learning never stops
View GitHub Profile
@aamnah
aamnah / markdown_sample.md
Last active June 27, 2024 12:47
An exhibit of Markdown
title Typography sample
date 2024-06-26
draft true
tags
sample

A lead or excerpt should go here. two or three lines are good. About 320 chars is also fine.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta, in dolores maxime eveniet saepe libero eum consequatur, commodi enim eos ab doloremque ratione illum quaerat voluptas ipsa explicabo corrupti laborum excepturi. Adipisci, dolores, recusandae! Sit tempora dolorum, ipsum cupiditate libero.
@aamnah
aamnah / typography_sample.html
Last active June 27, 2024 12:39
HTML Typography Tags
<p>A lead or excerpt should go here. two or three lines are good. About 320 chars is also fine.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta, in dolores maxime eveniet saepe libero eum consequatur, commodi enim eos ab doloremque ratione illum quaerat voluptas ipsa explicabo corrupti laborum excepturi. Adipisci, dolores, recusandae! Sit tempora dolorum, ipsum cupiditate libero.</p>
<!--more-->
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
@aamnah
aamnah / git-clone-bare.bash
Created January 28, 2017 05:10
Cloning a shared repo
# Cloning all branches locallay
# clone the repo as bare (no checked out files, nor working tree, .git in root dir)
git clone --bare http://whatever.git .git
# convert it to a normal repo
git config --bool core.bare false
git reset --hard
@aamnah
aamnah / table.css
Created January 26, 2017 06:50 — forked from colintoh/table.css
Table CSS
table { display: table }
tr { display: table-row }
thead { display: table-header-group }
tbody { display: table-row-group }
tfoot { display: table-footer-group }
col { display: table-column }
colgroup { display: table-column-group }
td, th { display: table-cell }
caption { display: table-caption }
@aamnah
aamnah / react-redux-async-loading.js
Created January 13, 2017 08:51
React/Redux lifecycle methods to call to avoid rendering React component before Redux data is back
/*
STATE SHAPE
mydata: { isFetching: bool, foo: [] }
*/
/*
DISPATCH
function mapDispatchToProps (dispatch) {
return {
fetchMeSomething: () => dispatch(fetchMeSomething())
@aamnah
aamnah / map-vs-for-loop.js
Last active January 2, 2017 16:52
Map vs. For Loop
/*
Loop over a two-dimensional array
https://jsfiddle.net/7p6g03z6/
*/
arr = ['Ali', 'Hakim', 'Rana', ['Shahid', 'Naeem']]
// Map and Conditional (ternary) Operator
arr.map(name => {
Array.isArray(name)
@aamnah
aamnah / array-filter-example1.js
Created December 25, 2016 18:20
Code examples for Array .filter() method
let items = [ 1, 2, 3, 4, 5, 6 ]
let filtered = items.filter(x => x > 3)
console.info('filtered:', filtered) // filtered: [ 4, 5, 6 ]
@aamnah
aamnah / array-concat.js
Created December 25, 2016 17:50
Code examples for the Array .concat() method
let nums = [1, 2]
let newNums = nums.concat(3)
console.info(newNums) // [ 1, 2, 3 ]
let moreNums = nums.concat(3, 4, 5)
console.info(moreNums) // [ 1, 2, 3, 4, 5 ]
let diverseNums = nums.concat(true, 'hello', undefined)
console.info(diverseNums) // [ 1, 2, true, 'hello', undefined ]
@aamnah
aamnah / table.html
Last active December 23, 2016 10:12 — forked from morrxy/gist:7542124
Table HTML
<table>
<caption>Awesome caption</caption>
<thead>
<tr>
<th></th>
<th>million km</th>
<th>m</th>
</tr>
</thead>
<tbody>
@aamnah
aamnah / redux-ajax.js
Created December 8, 2016 13:13
[work-in-progress] Redux + AJAX basics
// Basic AJAX Example
import React, { Component } from 'react'
import { render } from 'react-dom'
import { createStore, applyMiddleware, combineReducers } from 'redux'
import { Provider, connect } from 'react-redux'
import axios from 'axios'
import createLogger from 'redux-logger'
import thunkMiddleware from 'redux-thunk'
const logger = createLogger()