Skip to content

Instantly share code, notes, and snippets.

View Flet's full-sized avatar
💭
Feel free to @ me if I missed a notification

Dan Flettre Flet

💭
Feel free to @ me if I missed a notification
View GitHub Profile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
#!/usr/bin/env bash
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
cat >>~/.vimrc <<EOL
set nocompatible
call plug#begin()
Plug 'tpope/vim-sensible'
@bcomnes
bcomnes / jsfmt.sublime-settings
Created February 17, 2015 03:44
jsfmt.sublime-settings
{
// autoformat on save
"autoformat": true,
// array of extensions for autoformat
"extensions": ["js", "sublime-settings"],
// options for jsfmt
"options": {
"preset": "default",
@nodebotanist
nodebotanist / gist:0b976847f4c68eb389f8
Last active June 16, 2016 19:48
On "Real Coding," history, and what it means to be a programmer.

I'm sitting here, on a rainy Sunday morning in June 2015, in front of my MacBook Air, flipping switches on my Android, staring at the computer. A light bulb in my living room flickers from blue, to orange, to some weird green color. I'm tracking Bluetooth LE Characteristics. I have a Bluetooth light bulb, and they don't have a javascript API yet, so I'm using noble and node to write one.

I'm sitting there, a few miles away, in I want to say August 1999. I'm staring at a CRT monitor, and plugged into a USB port on my family's windows tower is a GameBoy GameShark that I took on a lot of chores and time to earn. plugged into that is some Harvest Moon game or another. I want to say I needed more tomato seeds. My child-brain decided that instead of figuring out a way to earn the in-game currency, I would alter the universe.

I wasn't the most straightforward-thinking kid.

Since then I've learned I could've just used Yahoo (or even Ask Jeeves!) for the codes. Instead I looked up how to make them: I found profanit

@mattdesl
mattdesl / about.md
Last active August 29, 2015 14:23
thoughts / proof of concept

The coolest thing about electron is that it blurs the line between "Node" and "Browser." Here is a Node.js module that typically doesn't work in the browser, but runs as expected in Electron:

var natural = require('natural')
console.log(natural.LevenshteinDistance('one', 'one'))

Example output:

image

@beaugunderson
beaugunderson / cool-modules.md
Last active February 2, 2023 19:58
cool modules from nodeconf

from streams session

  • end-of-stream - specify a callback to be called when a stream ends (which is surpsingly hard to get right)
  • duplexify - compose a Duplex stream from a Readable and a Writable stream
  • pump - pipe streams together and close all of them if one of them closes
  • pumpify - combine an array of streams into a single duplex stream using pump and duplexify
  • through2 - tools for making Transform streams
  • from2 - tools for making Readable streams

from "participatory modules" session

#!/usr/bin/env node
const cliclopts = require('cliclopts')
const minimist = require('minimist')
const fs = require('fs')
const quickStub = require('./')
const opts = cliclopts([
{

npm issues

npm had a security meltdown, what can we do?

This is a hard problem to solve, because it all comes down to trust. npm will probably try and solve parts of this (they have to now), but we should also be taking action on our end.

Immediate actions

@dannguyen
dannguyen / cpsc-recalls-json-getter.md
Last active May 29, 2016 03:31
Download and aggregate by year the number of consumer product recalls initiated by the Consumer Product Safety Commission (Python 3.x)

The homepage for the CPSC API can be found at: http://www.cpsc.gov/en/Recalls/CPSC-Recalls-Application-Program-Interface-API-Information/

There's even a programmer's manual: http://www.cpsc.gov/Global/info/Recall/CPSC-Recalls-Retrieval-Web-Services-Programmers-Guide_3-25-2015.pdf

And here's a stashed version of the 2016 data (as of April):

http://stash.compjour.org/samples/cpsc/recalls201604.json

However, a bare call of the endpoint -- http://www.saferproducts.gov/RestWebServices/Recall?format=json -- with no parameters beyond specifying JSON as the format seems to yield the entire collection: ~6,700 records at around 20MB.

@Flet
Flet / vortex_pok3r_arrow_key_shortcuts_README.md
Last active January 28, 2024 22:50
Vortex Pok3r keyboard arrow key shortcuts as CapsLock + WASD using xmodmap

Overview

Because my brain can't be untrained, I wanted to emulate the way I have my Vortex Pok3r keyboard arrow key shortcuts in software on my Linux (pop_os) lappy.

  • Emulates the my hardware macro setup on my Vortex keyboard but in software.
  • Hold CapsLock and use WASD as arrow keys
  • Uses xmodmap (I don't think it works on wayland?)
  • These steps work on pop_os with gnome.

Instructions