Skip to content

Instantly share code, notes, and snippets.

@chranderson
chranderson / nvmCommands.js
Last active May 8, 2024 17:29
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@mattbell87
mattbell87 / remote-wsl.md
Last active May 8, 2024 17:26
VSCode Remote: Connect to WSL2 from another machine

VSCode Remote: Connect to WSL2 from another machine

Do you want to do remote development on your WSL2 container in Visual Studio Code? Read this.

Proxy jump method

  1. On the host set up OpenSSH for Windows
  2. Run wsl --update to make sure you are running the latest WSL
  3. Open WSL and install another SSH server inside WSL with sudo apt-get install openssh-server
  4. Now run sudo systemctl enable --now ssh to automatically start ssh when WSL starts.
@xputerax
xputerax / cheatsheet.yml
Created June 8, 2019 09:45
YAML cheat sheet
# YAML cheat sheet
# Reference: https://www.youtube.com/watch?v=cdLNKUoMc6c
# object
person:
# string value. single/double quotes
# anchoring
name: &name "daniel" # anchor name doesn't have to be the same as key name
occupation: 'student'
# As of SQL 2017
/Record @id @type @time
/Record/ConnectivityTraceRecord/ClientConnectionId
/Record/ConnectivityTraceRecord/IsClient
/Record/ConnectivityTraceRecord/LocalHost
/Record/ConnectivityTraceRecord/LocalPort
/Record/ConnectivityTraceRecord/OSError
/Record/ConnectivityTraceRecord/RecordSource
/Record/ConnectivityTraceRecord/RecordTime
@wmedlar
wmedlar / Pseudopotential-Derived Band Structure of Silicon.ipynb
Last active May 8, 2024 17:21
The band structure of Silicon is calculated using the empirical pseudopotential method implemented in the Python programming language. A generalized routine is able to calculate the band structure of diamond and zincblende lattices. The energy splittings for Silicon at symmetry points appear to be very accurate with accepted values by diagonaliz…
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jordandee
jordandee / sdl2_opengl.cpp
Last active May 8, 2024 17:19
Simple SDL2/OpenGL example
// To compile with gcc: (tested on Ubuntu 14.04 64bit):
// g++ sdl2_opengl.cpp -lSDL2 -lGL
// To compile with msvc: (tested on Windows 7 64bit)
// cl sdl2_opengl.cpp /I C:\sdl2path\include /link C:\path\SDL2.lib C:\path\SDL2main.lib /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libcmtd.lib opengl32.lib
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
@danielpaul
danielpaul / revision.java
Last active May 8, 2024 17:19
Basic Java Revision Notes - Written in Java
/*
*
* / --------------------------------[ NUIM CS141 Java Revision ]------------------------------- \
* || Designed to easily revise everything covered in CS141 by just reading through this code. ||
* || Comments accompany almost every line of code to explain its purpose. ||
* || Some theory we need to know are included in the bottom... ||
* \ ------------------------------------------------------------------------------------------- /
*
*
* ____ _ __ ____ __
@entaroadun
entaroadun / gist:1653794
Created January 21, 2012 20:10
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

tutorial ic, criando rede entre containers docker:
1 - criar uma rede personalizada para os seus contêineres se conectarem, especificando uma rede no arquivo docker-compose:
networks:
minha-rede:
driver: bridge
a rede vai levar o nome do container que tem o "driver:bridge" ao levantar o container ($docker compose up -d) ;
@virtuald
virtuald / sshpass.py
Created December 20, 2014 19:49
Simple python wrapper to give SSH a password for automation purposes (with output capture)
#!/usr/bin/env python3
import os
import sys
_b = sys.version_info[0] < 3 and (lambda x:x) or (lambda x:x.encode('utf-8'))
def ssh_exec_pass(password, args, capture_output=False):
'''
Wrapper around openssh that allows you to send a password to