Skip to content

Instantly share code, notes, and snippets.

View heypoom's full-sized avatar
🏠
Working from home

Phoomparin Mano heypoom

🏠
Working from home
View GitHub Profile
@heypoom
heypoom / phoomparin.py
Created April 15, 2017 04:27
(By Phoomparin) Some practice questions that asked you to print a wall -- in Python.
#!/usr/bin/python3
import sys
import math
# Figure out the width and height of our grid.
def getGridSize(boxes):
# For the walls (#)
# Exclude the center, times two for both sides, and add the center back.
walls = ((boxes - 1) * 2) + 1
return walls + (walls - 1)
#compdef docker-compose
# Description
# -----------
# zsh completion for docker-compose
# -------------------------------------------------------------------------
# Authors
# -------
# * Steve Durrheimer <s.durrheimer@gmail.com>
# -------------------------------------------------------------------------
#compdef docker dockerd
#
# zsh completion for docker (http://docker.com)
#
# version: 0.3.0
# github: https://github.com/felixr/docker-zsh-completion
#
# contributors:
# - Felix Riedel
# - Steve Durrheimer
#compdef docker-machine
# Description
# -----------
# zsh completion for docker-machine
# https://github.com/leonhartX/docker-machine-zsh-completion
# -------------------------------------------------------------------------
# Version
# -------
# 0.1.1
# -------------------------------------------------------------------------

Keybase proof

I hereby claim:

  • I am phoomparin on github.
  • I am phoomparin (https://keybase.io/phoomparin) on keybase.
  • I have a public key ASDbUg3L1z88DBiBPgrJpjlmFMeRFYN0OPrdir3p7FJXRgo

To claim this, I am signing this object:

@heypoom
heypoom / fb_helper.js
Created December 2, 2017 09:22
I'm lazy to use graph api and I just wanted to know what do people comment on FB, so here it is.
const getCommentsWithTime = () => [...document.querySelectorAll('.UFIComment')].map(comment => {
const body = comment.querySelector('.UFICommentActorAndBody')
if (body) {
return {
user: body.querySelector('.UFICommentActorName').innerText,
text: body.querySelector('span:nth-child(2)').innerText,
timestamp: comment.querySelector('.livetimestamp').innerText
}
}
'use strict';
var blacklist = require('./node_modules/react-native/packager/blacklist');
var path = require('path');
/**
* Default configuration for the CLI.
*
* If you need to override any of this functions do so by defining the file
@heypoom
heypoom / RNfontWeights.js
Created December 13, 2017 07:25 — forked from knowbody/RNfontWeights.js
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
{
"parser": "babel-eslint",
"extends": [
"standard",
"plugin:react/recommended",
"prettier",
"prettier/react",
"prettier/standard"
],
"plugins": ["react", "prettier", "standard"],
function clone(data) {
if (Array.isArray(data)) {
return data.map(clone)
} else if (data.constructor === Object) {
return Object.entries(data)
.map(([key, value]) => ({[key]: clone(value)}))
.reduce((obj, cur) => ({...obj, ...cur}))
}
return data
}