Skip to content

Instantly share code, notes, and snippets.

View Psycadelik's full-sized avatar
💎
Drawing constellations

Adrian Psycadelik

💎
Drawing constellations
  • Nairobi
  • 04:29 (UTC +03:00)
View GitHub Profile
@Psycadelik
Psycadelik / installing-node-with-nvm.md
Created October 15, 2022 09:37 — forked from d2s/installing-node-with-nvm.md
Installing Node.js to Linux & macOS & WSL with nvm

Installing Node.js with nvm to Linux & macOS & WSL

A quick guide on how to setup Node.js development environment.

Install nvm for managing Node.js versions

nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.

  1. Open new Terminal window.
@Psycadelik
Psycadelik / lamda_calculus_from_the_ground_up.py
Created August 13, 2022 11:42 — forked from TralahM/lamda_calculus_from_the_ground_up.py
Lambda Calculus from the ground up in pure functional python: from basic boolen,to arithmetic, to recursion, to the all famous Y-combinator all using pure python functions
def TRUE(x):
return lambda y: x
def FALSE(x):
return lambda y: y
def NOT(x):
return x(FALSE)(TRUE)
@Psycadelik
Psycadelik / curl.md
Created December 24, 2021 13:43 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@Psycadelik
Psycadelik / jq-cheetsheet.md
Created December 10, 2021 11:43 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@Psycadelik
Psycadelik / knight-moves.js
Created July 25, 2020 20:36 — forked from seyfer/knight-moves.js
Toptal Codility Problem: Can Knight reach square?
'use strict';
function getNextPositions(start) {
var moves = [
{ x: -2, y: -1 },
{ x: -2, y: +1 },
{ x: -1, y: -2 },
{ x: -1, y: +2 },
{ x: +1, y: -2 },
{ x: +1, y: +2 },
@Psycadelik
Psycadelik / System Design.md
Created July 15, 2020 09:04 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@Psycadelik
Psycadelik / unnittestexample.py
Created October 23, 2019 08:21 — forked from Bergvca/unnittestexample.py
Some unnittest + Mock examples in Python. Includes examples on how to mock a entire class (ZipFile), mock an Iterator object and how to use side_effect properly
import unittest
import os
from zipfile import ZipFile
from mock import MagicMock, patch, Mock, mock_open
# The functions that are tested:
def function_to_test_zipfile(example_arg):
with ZipFile(example_arg, 'r') as zip_in:
for input_file in zip_in.infolist():
@Psycadelik
Psycadelik / Update remote repo
Created January 18, 2019 08:48 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
1. Move to your /var/www directory
cd /var/www
2. Install laravel
laravel new myapp
OR
composer create-project --prefer-dist laravel/laravel myapp