Skip to content

Instantly share code, notes, and snippets.

View robertgrzonka's full-sized avatar
🤍
spreading love since '91

robertgrzonka robertgrzonka

🤍
spreading love since '91
View GitHub Profile
{
"type": "object",
"properties": {
"DialCapture": {
"then": {
"properties": {
"General": {
"type": "object",
"properties": {
"GeneralGroup1": {
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@robertgrzonka
robertgrzonka / properties.js
Last active March 25, 2019 23:56
Personal notes about Objects properties
const foo = {
bar: 'baz',
qux: 'quux'
}
Object.defineProperty(foo, 'bar', { writable: false }) // code in next line won't change property
foo.bar = 'cargo' // this won't work
console.log(foo) // still: bar = 'baz'
console.log(Object.getOwnPropertyDescriptors(foo)) // baz is not-writable
@robertgrzonka
robertgrzonka / .hyper.js
Created February 7, 2019 23:26
Hyper Configuration File
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'canary',
@robertgrzonka
robertgrzonka / streams.md
Created February 7, 2019 23:25
Few notes about streams in Node.js

Node.js 🦑 forthebadge forthebadge forthebadge

Stream 🔥

Two ways of streaming in Node.js:

readable.pipe(writable)
@robertgrzonka
robertgrzonka / functions.sh
Created February 7, 2019 23:19
Couple of useful shell functions.
###
# open_repo <name: $1> open new local project
# git_init <name: $1> open new repository on GitHub
###
# The only argument which should be pass into commands is you <project_name>.
# $1 will be overwritten with it.
###
# It's made for OAuth verification, so you need to provie your GitHub Token with proper access.
function open_repo() {
@robertgrzonka
robertgrzonka / getopts.sh
Created January 24, 2019 20:33
How to add flag to commands in shell env.
#!/bin/zsh
chmod +x getopts.sh
while getopts ":a:" opt; do
case $opt in
a)
if [ ! -d "$OPTARG" ]; then
[ -f "$OPTARG" ] && echo "Opening file..." && open "$OPTARG"
elif [ -d "$OPTARG" ]; then
echo "Opening folder..." && open "$OPTARG"
@robertgrzonka
robertgrzonka / node-fs-read-append.js
Last active January 24, 2019 20:35
How to create new file with encrypted data (or append it into existing one) with Node.js.
/* more info: https://nodejs.org/dist/latest-v11.x/docs/api/buffer.html */
const options = {
path: '/Path/to/your/file',
pass: 'your-password',
encoding: 'base64'
}
const {path, data, encoding, ...others} = options
const append = fs.appendFile(path, pass, encoding, (pass) => {
@robertgrzonka
robertgrzonka / README-Template.md
Created November 1, 2018 01:37 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@robertgrzonka
robertgrzonka / .git-commit-template.txt
Created September 16, 2018 11:54 — forked from adeekshith/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23