Skip to content

Instantly share code, notes, and snippets.

:octocat:
0_0

Paul Pushplaybang

:octocat:
0_0
Block or report user

Report or block Pushplaybang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:de8e16e78e76fb4aca0e86c6734cfeaf

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 Oct 14, 2018
very simple example of concurrency in go.
View main.go
package main
import (
"fmt"
"net/http"
)
func main() {
links := []string{
"http://golang.org",
@Pushplaybang
Pushplaybang / static-fs.go
Created Oct 7, 2018
simplest static file server in Go
View static-fs.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 Oct 7, 2018
Docker cheat sheet
View docker-basics.md

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 <container-name> <override>
@Pushplaybang
Pushplaybang / express-static-server.js
Created Oct 6, 2018
most basic express js static server
View express-static-server.js
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 Sep 21, 2018
Incredibly basic toy ETH smart contract.
View inbox.sol
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 Aug 21, 2018 — forked from davej/transitionToPromise.js
Do a CSS transition and resolve promise when complete
View transitionToPromise.js
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 Jun 28, 2018
Install and run mongo OSX
View mongoinstall.md

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
View neo4j_cypher_cheatsheet.md

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 — forked from kevyworks/prep-ncv-env.sh
Prepare Dev Machine for: Node Composer & Laravel Valet
View prep-ncv-env.sh
# 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
You can’t perform that action at this time.