Skip to content

Instantly share code, notes, and snippets.

View rjmacarthy's full-sized avatar
🐁
The Tetris effect

rj rjmacarthy

🐁
The Tetris effect
  • The Wilderness
  • 03:35 (UTC +01:00)
View GitHub Profile
@rjmacarthy
rjmacarthy / unsplash
Last active May 12, 2016 10:06
Stock Images
https://unsplash.com/
https://www.pexels.com/
https://bootstrapbay.com/blog/free-stock-photos/
Free stock images.
@rjmacarthy
rjmacarthy / index.html
Last active July 27, 2016 13:52
Es6 Starter - webpack | babel and package.json
<html>
<head>
<title></title>
</head>
<body>
<script src="bundle.js"></script>
</body>
</html>
@rjmacarthy
rjmacarthy / cmd
Created August 4, 2016 10:27
Docker command for cmd on windows
FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd default') DO %i
@rjmacarthy
rjmacarthy / App.js
Last active August 9, 2016 08:54
Redux Thunk Boilerplate
import React, { Component } from 'react';
class App extends Component {
render() {
return (
<div>
<p>Header here</p>
<div className="container">
{this.props.children}
@rjmacarthy
rjmacarthy / cmd
Last active August 9, 2016 19:38
docker postgres
Run docker-machine env to get docker-machine host
psql -h [docker-machine host] -U youruser
psql -h 192.168.99.100 -U admin
psql -h 172.17.0.1 -U admin
@rjmacarthy
rjmacarthy / mysql
Last active August 11, 2016 10:53
docker mysql
FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd default') DO %i
# Install
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=password -d mysql:tag
# Go to bash
docker exec -it some-mysql bash
# mysql
@rjmacarthy
rjmacarthy / draggable-polygon
Created September 1, 2016 14:14
Draggable polygon fiddle
https://jsfiddle.net/3L140cg3/16/
upstream app_www {
server 127.0.0.1:3000;
}
# the nginx server instance
server {
listen 80;
server_name www.www;
return 301 http://www.www.www;
@rjmacarthy
rjmacarthy / binary-gap.js
Last active December 5, 2018 11:46
Binary Gap JavaScript
var tests = [234534534234];
tests.forEach(function (t) {
Test(t);
});
function Test(N) {
var bin = N.toString(2);
var b = 0;
var col = bin.split("1").filter(function (val) {
@rjmacarthy
rjmacarthy / interval.js
Created October 10, 2016 15:50
Interval without setTimeout
import { random, delay } from 'lodash';
export const interval = (fn) => {
fn();
delay(() => { interval(fn); }, randomNumber());
};
var randomNumber = () => {
return random(1000, 10000)
};