Skip to content

Instantly share code, notes, and snippets.

@hexagon5un
hexagon5un / hull.scad
Created February 4, 2018 22:50
OpenSCAD Hull Functions Library
module multiHull(){
for (i = [1 : $children-1])
hull(){
children(0);
children(i);
}
}
module sequentialHull(){
for (i = [0: $children-2])
@emoryy
emoryy / arduino-blinkt.ino
Created November 9, 2017 12:25
Arduino Blinkt!
#include <Adafruit_DotStar.h>
#include <SPI.h>
#define NUMPIXELS 8 // Number of LEDs in strip
// Here's how to control the LEDs from any two pins:
#define DATAPIN 4
#define CLOCKPIN 5
Adafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BGR);
@anmoljagetia
anmoljagetia / appify
Created August 7, 2017 12:33
Appify script to create MacOS apps from scripts.
#!/usr/bin/env bash
Appify="$(basename "$0")"
if [ ! "$1" -o "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF
Appify v5 for Mac OS X
Creates the simplest possible Mac OS X app from a shell script.
Takes a shell script as its first argument:
@rragundez
rragundez / args_script_template.sh
Created June 21, 2017 09:11
Template of bash script with mandatory and optional arguments
#!/bin/bash
set -e
usage="$(basename "$0") [-h] [-i PROJECT] [-v VM] [-p PYTHON] [-d NOTEBOOKS]
Make a user provide SSH key and jupyter notebooks (in roles/bootstrap/files/notebooks) to each user listed in var/common.yml
where:
-h show this help text
-i google cloud project id
-v name of instance/virtual machine
-p python path
@gesquive
gesquive / cmd.go
Created April 27, 2017 21:48
Run an external command with golang
// run a command using the shell; no need to split args
// from https://stackoverflow.com/questions/6182369/exec-a-shell-command-in-go
func runcmd(cmd string, shell bool) []byte {
if shell {
out, err := exec.Command("bash", "-c", cmd).Output()
if err != nil {
log.Fatal(err)
panic("some error found")
}
return out
@maximilian-lindsey
maximilian-lindsey / express_in_electron.md
Last active March 29, 2024 22:46
How to run Express inside an Electron app

How to run Express inside an Electron app

You can run your Express app very easily inside your Electron app.

All you need to do is to:

  • place all the files of your Express app inside a new app folder in your_electron_app\resources\app
  • reconfigure the app.js file
  • refactor some relative pathes in your Express app
@neatshell
neatshell / myscript
Last active February 26, 2024 22:50
simple bash template that handles mandatory and optional arguments
#!/bin/bash
script="myscript"
#Declare the number of mandatory args
margs=2
# Common functions - BEGIN
function example {
echo -e "example: $script -m0 VAL -m1 VAL -o1 -o2 VAL"
}