Skip to content

Instantly share code, notes, and snippets.

View m0sk1t's full-sized avatar

m0sk1t m0sk1t

View GitHub Profile
@m0sk1t
m0sk1t / .eslintrc.json
Created October 21, 2022 23:33
ESLint for React\TS
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"prettier",
"eslint:recommended",
"plugin:react/recommended",
"standard-with-typescript"
@m0sk1t
m0sk1t / 2019-https-localhost.md
Created March 26, 2020 21:14 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@m0sk1t
m0sk1t / fetcher.py
Created April 5, 2019 21:28
Fetcher
#!/bin/python3
import sys
import os
from urllib.request import Request
from urllib.request import urlopen
from urllib.error import URLError
import json
# Complete the function below.
''' Response:
@m0sk1t
m0sk1t / vagrant-ssh-node
Created March 27, 2019 18:20 — forked from neilk/vagrant-ssh-node
SSH into a Vagrant VM, such that Node.js can be debugged from a debugger or IDE in the host operating system. For some reason, port forwarding in the Vagrant file does not work. See https://groups.google.com/forum/#!topic/vagrant-up/RzPooJ0dp6Q
#!/bin/bash
# SSH into a Vagrant VM, forwarding ports in a way that allows node within Vagrant to be debugged by a debugger
# or IDE in the host operating system. Don't know why, but Vagrantfile port forwarding does not work.
# (https://groups.google.com/forum/#!topic/vagrant-up/RzPooJ0dp6Q)
/usr/bin/vagrant ssh-config > $TMPDIR/vagrant-ssh-config
ssh -F $TMPDIR/vagrant-ssh-config -L 5858:127.0.0.1:5858 default
rm $TMPDIR/vagrant-ssh-config
@m0sk1t
m0sk1t / pymaze.py
Last active December 5, 2018 14:26
pymaze
#!/usr/bin/python3
import os
import pygame
from random import choice
class Cell():
def __init__(self, x, y, w, h=None):
@m0sk1t
m0sk1t / maze.py
Created December 1, 2018 18:49 — forked from FrankRuis/maze.py
Pygame maze generator
import pygame
from random import choice
class Cell(pygame.sprite.Sprite):
w, h = 16, 16
def __init__(self, x, y, maze):
pygame.sprite.Sprite.__init__(self)
@m0sk1t
m0sk1t / locale-add-ubuntu.sh
Created July 18, 2018 19:17
Add and update locales on Ubuntu
sudo apt-get install language-pack-en language-pack-gnome-en
sudo update-locale LANG=en_US.UTF-8
sudo locale-gen en_US.UTF-8
@m0sk1t
m0sk1t / Android Privacy Policy Template
Created June 19, 2018 19:01 — forked from alphamu/Android Privacy Policy Template
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@m0sk1t
m0sk1t / .md
Created April 9, 2018 07:45 — forked from joepie91/.md
Running a Node.js application using nvm as a systemd service

Trickier than it seems.

1. Set up nvm

Let's assume that you've already created an unprivileged user named myapp. You should never run your Node.js applications as root!

Switch to the myapp user, and do the following:

  1. curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash (however, this will immediately run the nvm installer - you probably want to just download the install.sh manually, and inspect it before running it)
  2. Install the latest stable Node.js version: nvm install stable
var app = express();
app.io = require('socket.io')();
var routes = require('./routes/index')(app.io);
app.use('/', routes);