Skip to content

Instantly share code, notes, and snippets.

View Pushplaybang's full-sized avatar
:octocat:
0_0

Paul Pushplaybang

:octocat:
0_0
View GitHub Profile

BEM Cheatsheet

BLOCK

Block encapsulates a standalone entity that is meaningful on its own.

While blocks can be nested and interact with each other, semantically they remain equal; there is no precedence or hierarchy.

Holistic entities without DOM representation (such as controllers or models) can be blocks as well.

@Pushplaybang
Pushplaybang / main.go
Created October 14, 2018 11:35
very simple example of concurrency in go.
package main
import (
"fmt"
"net/http"
)
func main() {
links := []string{
"http://golang.org",
@Pushplaybang
Pushplaybang / static-fs.go
Created October 7, 2018 19:27
simplest static file server in Go
package main
import (
"net/http"
"os"
)
func main() {
dir, _ := os.Getwd()
http.ListenAndServe(":3000",http.FileServer(http.Dir(dir+"/public")))
@Pushplaybang
Pushplaybang / docker-basics.md
Last active October 7, 2018 19:37
Docker cheat sheet

MY Docker Cheat Sheet

a breif selection of essential commands, tips and notes about working with docker, as a personal reference. use at your own risk.

Working with containers

create and start a container

  • docker run [-a] <container-name> <override>

essentially runs the following two commands

  • docker create
@Pushplaybang
Pushplaybang / express-static-server.js
Created October 6, 2018 14:16
most basic express js static server
const path = require('path');
const express = require('express');
// x platform path
const publicPath = path.join(__dirname, './public');
// setup
const app = express();
app.use(express.static(publicPath));
@Pushplaybang
Pushplaybang / inbox.sol
Created September 21, 2018 17:59
Incredibly basic toy ETH smart contract.
pragma solidity ^0.4.17;
contract Inbox {
string public message;
function Inbox(string initialMessag) public {
message = initialMessag;
}
function setMessage(string newMessage) public {
@Pushplaybang
Pushplaybang / transitionToPromise.js
Last active August 21, 2018 18:16 — forked from davej/transitionToPromise.js
Do a CSS transition and resolve promise when complete
const transitionToPromise = (selector, property, value) =>
new Promise(resolve => {
const el = docxument.querySelector(selector);
el.style[property] = value;
const transitionEnded = e => {
if (e.propertyName !== property) {
return;
}
el.removeEventListener('transitionend', transitionEnded);
@Pushplaybang
Pushplaybang / mongoinstall.md
Created June 28, 2018 11:30
Install and run mongo OSX

Installing Mongo on OSX with brew

We'll need to update brew, install mongo, setup the location where data will be stored and know how to stop and start the DB.

Get started:

# update brew
brew update

# install mongo
@Pushplaybang
Pushplaybang / neo4j_cypher_cheatsheet.md
Created June 17, 2018 13:05 — forked from DaniSancas/neo4j_cypher_cheatsheet.md
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
@Pushplaybang
Pushplaybang / prep-ncv-env.sh
Created May 7, 2018 09:55 — forked from kevyworks/prep-ncv-env.sh
Prepare Dev Machine for: Node Composer & Laravel Valet
# install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Terminal Aliases
echo "alias artisan='php $PWD/artisan'" >> ~/.bash_profile
echo "export NVM_DIR=~/.nvm" >> ~/.bash_profile
echo "source $(brew --prefix nvm)/nvm.sh" >> ~/.bash_profile
# update brew
brew update