Skip to content

Instantly share code, notes, and snippets.

View remarkablemark's full-sized avatar

Mark remarkablemark

View GitHub Profile
@remarkablemark
remarkablemark / syncing-a-fork.md
Created July 6, 2016 15:34
Syncing a forked repository.

Syncing a forked repository

Add a remote called upstream (name is a convention):

git remote add upstream https://github.com/<original_owner>/<original_repository>.git
git remote -v

Fetch the branches and their respective commits from the upstream repository:

@remarkablemark
remarkablemark / learning-resources.md
Last active July 11, 2016 20:12
Learning resources pertaining to computer science and other topics.
@remarkablemark
remarkablemark / README.md
Last active July 7, 2016 16:29
Docker Compose and WordPress.

Docker Compose and WordPress

Build:

docker-compose up # pass `-d` flag to detach and hide output

Open:

open "http://$(docker-machine ip):8000"
@remarkablemark
remarkablemark / hide-status-bar-in-iphone-simulator.md
Created July 13, 2016 00:16
How to hide the status bar in the iPhone Simulator.

Hide status bar in iPhone Simulator

  1. Open Info.plist.
  2. Add row with key View controller-based status bar appearance and value NO if not present.
  3. Add row with key Status bar is initially hidden with value YES if not present.
  4. Save and run the project.

Source

@remarkablemark
remarkablemark / ReactClass.jsx
Last active July 27, 2016 16:13
Creating a React component with `React.createClass` versus `React.Component`.
'use strict';
var React = require('react');
var ReactClass = React.createClass({
displayName: 'ReactClass',
// https://facebook.github.io/react/docs/reusable-components.html#mixins
mixins: [],
@remarkablemark
remarkablemark / README.md
Created August 6, 2016 19:36
A Flask quickstart template.

flask-template

A quickstart Flask template.

Install

pip install -r requirements.txt # you may need `sudo`
@remarkablemark
remarkablemark / vim-tips.md
Last active November 7, 2018 17:10
A collection of useful VIM tips and tricks.

Vim Tips

Type Action Command
Editor Reload window :e
:edit
Horizontal split Ctrl w, s
:sp
:split
Vertical split Ctrl w, v
:vs
:vsplit
Switch between windows Ctrl w, (xor Ctrl w, h, j, k, l)
Open new tab :tabe
Go to next tab gt
@remarkablemark
remarkablemark / node-change-this-context.md
Created August 22, 2016 19:51
Node.js run module with a different `this` context.
@remarkablemark
remarkablemark / date-id-generator.js
Created August 28, 2016 19:27
Generate an alphanumeric ID based on the JavaScript Date object.
'use strict';
/**
* Generate an alphanumeric ID based on Date.
* @return {String} - The alphanumeric ID.
*/
function dateIdGenerator() {
// `valueOf` returns the milliseconds since midnight 01 January, 1970 UTC
// then convert to Base36
return new Date().valueOf().toString(36);
@remarkablemark
remarkablemark / map.js
Last active September 2, 2016 20:04
The map() method creates a new array with the results of calling a provided function on every element in this array.
'use strict';
/**
* Map an array.
*
* @param {Array} arr - The array to be mapped.
* @param {Function} fun - The map function.
* @return {Array} - The mapped array.
*/
function map(arr, fun) {