Skip to content

Instantly share code, notes, and snippets.

@srvanderplas
srvanderplas / Rpkginstall
Created May 2, 2024 15:00
Install all R packages loaded in any files within a folder
#!/bin/bash
# This concatenates array values using a multi-character separater.
# https://dev.to/meleu/how-to-join-array-elements-in-a-bash-script-303a
joinByString() {
local separator="$1"
shift
local first="$1"
shift
printf "%s" "$first" "${@/#/$separator}"
@askpatrickw
askpatrickw / ESP32S2-Camera-Interface-Research.md
Last active May 2, 2024 15:00
Research about the ESP32-S2 Camera Interface

Research about the ESP32-S2 Camera Interface

I am very interested in the ESP32-S2's camera port and the possibility of using it for a variety of MicroPython\CircuitPython projects. My hope is that the ESP32-S2 will the ability to do do things similiar to what is possible on the Raspberry Pi. Today there is no ESP32-S2 board available which exposes this port, and no camera modeles, but I wanted to understand the hardware capabilities to understand what might be possible and just as important, what is not.

This write up is based on solely on a morning's worth of research. If there are errors

@pedrominicz
pedrominicz / fib.c
Last active May 2, 2024 14:59
Multithreaded Fibonacci using POSIX threads.
#include <pthread.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// This program illustrates the use of POSIX threads.
//
// A POSIX thread has two main components: an object of type `pthread_t` which
@johnchandlerburnham
johnchandlerburnham / ATaxonomyOfSelfTypes.md
Last active May 2, 2024 14:59
A Taxonomy of Self Types

A Taxonomy of Self-Types

Part I: Introduction to Self-Types

Datatypes in the Formality programming language are built out of an unusual structure: the self-type. Roughly speaking, a self-type is a type that can depend or be a proposition on it's own value. For instance, the consider the 2 constructor datatype Bool:

@soheilsec
soheilsec / 6to4 to multiple host
Created February 9, 2024 09:01
6to4 to multiple host
#!/bin/bash
#IRAN
# First 6to4 tunnel
ip tunnel add 6to4tun_IR mode sit remote 108.1.1.1 local 193.1.1.1
ip -6 addr add 2001:470:1f10:e1f::1/64 dev 6to4tun_IR
ip link set 6to4tun_IR mtu 1480
ip link set 6to4tun_IR up
# Second 6to4 tunnel
@islomar
islomar / gitignore-java-mac
Last active May 2, 2024 14:55
Basic gitignore for Java and Mac:
# git config --global core.excludesfile ~/.gitignore_global
# Some common .gitignore configurations: https://gist.github.com/octocat/9257657
# Copy the next content on the .gitignore_global file:
.DS_Store
*.class
@yagays
yagays / _samtools
Created October 23, 2011 04:09
zsh completion function of samtools
#compdef samtools
################################################
# SAMtools commands and options are based on ver. 0.1.18
# http://samtools.sourceforge.net/samtools.shtml
#
# Edited by yag_ays 2011.10.25
################################################
_samtools() {
@aydynx
aydynx / discord.md
Last active May 2, 2024 14:48
discord stuff

tokens

all scripts written by me
they should continue working until the next webpack update

obtaining your token

v1:

webpackChunkdiscord_app.push([[0],,e=>Object.keys(e.c).find(d=>(t=e(d)?.default?.getToken?.())&&console.log(t))])

v2:

@leommoore
leommoore / file_magic_numbers.md
Last active May 2, 2024 14:47
File Magic Numbers

File Magic Numbers

Magic numbers are the first bits of a file which uniquely identify the type of file. This makes programming easier because complicated file structures need not be searched in order to identify the file type.

For example, a jpeg file starts with ffd8 ffe0 0010 4a46 4946 0001 0101 0047 ......JFIF.....G ffd8 shows that it's a JPEG file, and ffe0 identify a JFIF type structure. There is an ascii encoding of "JFIF" which comes after a length code, but that is not necessary in order to identify the file. The first 4 bytes do that uniquely.

This gives an ongoing list of file-type magic numbers.

Image Files

Deploying Julia on heroku

Let's assume that you can run your web server on your own computer, and that you can open it in your own browser (through localhost or 127.0.0.1). This guide will go through the steps of putting that app online!

This guide will be based on a hello world sample project that uses Genie.jl, but the steps from this guide apply to any Julia web framework.

heroku has tons of features, but for a simple app, we only need the basics. In particular, we do not need the heroku command line, we can do everything through the online GUI.

Basics

heroku uses git for deployment: to package your app, you create a git repository, and to put a new version of your app online, you push to the git repository. If you already know git, then you now know how to manage a web server! It's like GitHub pages, but more powerful (and more complicated). Read heroku's introduction for a basi