This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lftp -e 'mirror -c -R /path/to/local/folder /path/to/remote/folder' -u 'your_username,your_password' the-remote-ftp-server.com | |
# -c means resume the upload where you left off the last time you ran lftp before it got terminated. | |
# -R means reverse mirror. This will tell lftp to upload from local to remote, instead of download from remote to local. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import strformat | |
import karax / [karaxdsl, vdom] | |
# want to use this like so | |
# linkItem: | |
# a(href="/"): text "Main Page" | |
template linkItem(body: untyped): VNode = | |
buildHtml(li(class="hover:underline text-center")): | |
h4: | |
li: body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL2/SDL.h> | |
#define MUS_PATH "Roland-GR-1-Trumpet-C5.wav" | |
// prototype for our audio callback | |
// see the implementation for more information | |
void my_audio_callback(void *userdata, Uint8 *stream, int len); | |
// variable declarations | |
static Uint8 *audio_pos; // global pointer to the audio buffer to be played |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install ARCH Linux with encrypted file-system and UEFI | |
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
# Download the archiso image from https://www.archlinux.org/ | |
# Copy to a usb-drive | |
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. | |
# Set swiss-french keymap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import log | |
def calcShannonEnt(dataSet): | |
numEntries = len(dataSet) | |
labelCounts = {} | |
for featVec in dataSet: | |
currentLabel = featVec[-1] | |
if currentLabel not in labelCounts.keys(): | |
labelCounts[currentLabel] = 0 | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; hello world in Racket | |
;; comments begin with ; | |
;; some people like to use ;; | |
;; function application is done by surrounding the function name and arguments in parens | |
;; | |
;; if you have seen languages like Python or JavaScript, f(a,b,c) is (f a b c) in scheme | |
(displayln "Hello, world!") |