Skip to content

Instantly share code, notes, and snippets.

View vjandrei's full-sized avatar
:octocat:
Chill and Family

Andreas Koutsoukos vjandrei

:octocat:
Chill and Family
View GitHub Profile
@shnigi
shnigi / shnigidash.js
Last active March 10, 2022 08:14
Lodash vanilla utility - shnigidash
// UTILITY
const cars = [
{ type: 'mazda', driven: 14020, active: true },
{ type: 'volvo', driven: 404324, active: false },
{ type: 'nissan', driven: 135223, active: true }
];
// MAP FUNCTIONS
const shnigimap = (arr, mapfunc) => {
const resultArray = [];

Robot Uprising - Microsoft Azure

Activate Azure

You can activate a free Microsoft Azure account at http://azure.com/free

For the purpose of the hackathon, we're providing you with free Azure Pass codes worth 100$ and valid for 30-days.

Activate your Azure Pass

@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 21, 2024 22:10
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@JeremyIglehart
JeremyIglehart / create_new_user.md
Last active February 8, 2023 18:36
How to create a new user and remove the `pi` user on a Raspberry Pi

How to create a new user and remove the pi user on a Raspberry Pi

Note: This has been tested in Rasbian Buster released on 2019-06-20

Important: replace jeremy below with whatever username you'd like as your new user.

  1. sudo adduser jeremy
    • You will be asked to enter a password
    • When filling out basic information about the user, you may leave it blank
@JamieMason
JamieMason / pluck-unique-values-from-array-of-javascript-objects.md
Created September 14, 2018 08:14
Pluck Unique Values from Array of Javascript Objects

Pluck Unique Values from Array of Javascript Objects

Implementation

const pluck = key => array => Array.from(new Set(array.map(obj => obj[key])));

Usage

@JamieMason
JamieMason / group-objects-by-property.md
Created September 14, 2018 07:38
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
@woltage
woltage / getdomains.sh
Last active January 18, 2024 12:57
Skripti jolla saa Y-tunnukella kaikki firman omistamat .fi -verkkotunnukset
## Y-Tunnukseen perustuva domainejen haku (.fi)
## Esimerkki: getdomains 1093944-1 # MTV Oy
# Laita tämä .bashrc tai .zshrc
# Käyttöesimerkkejä:
# Looppaa Y-tunnuksetn kaikki domainit läpi ja tee kysely
# for i in $(getdomains 1093944-1); do echo $i && host -t cname www.$i; done
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 24, 2024 14:17
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@tuxfight3r
tuxfight3r / bind_socket.py
Last active April 24, 2023 14:27
python tcp socket client / server examples
#!/usr/bin/python
import socket #for sockets
import sys #for exit
try:
#create an AF_INET, STREAM socket (TCP)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error, msg:
print 'Failed to create socket. Error code: ' + str(msg[0]) + ' , Error message : ' + msg[1]
@martinrisseeuw
martinrisseeuw / correct.vue
Last active June 2, 2020 04:35
Mapbox Nuxt component
<template>
<div id="map" class="map">
<div class="button-bar">
<button v-on:click="addMapLayer()">terrain</button>
</div>
</div>
</template>
<script>