A Pen by Jeff Laughlin on CodePen.
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
#!/usr/bin/env python | |
from sys import argv | |
from argparse import ArgumentParser | |
from os.path import join, exists | |
from os import link, symlink, makedirs | |
parser = ArgumentParser() | |
parser.add_argument('input') | |
parser.add_argument('output', default='.') |
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
/** | |
* Experimental optimistically-locking cache-manager store wrapper | |
* | |
* Completely untested; caveat emptor | |
*/ | |
const inspect = require('util').inspect | |
export const LOCK_TIMEOUT = 5000 | |
export const LOCK_EXTEND_TIMEOUT = 2500 |
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
/** Experimental virtual file system thing | |
* it doesn't really work with the sync FS api | |
* untested | |
*/ | |
const MAX_FILE_SIZE = 1024 * 1024 * 10 // 10MB | |
class CachedFile { | |
constructor (cache, path, { maxFileSize = MAX_FILE_SIZE }) { | |
this.cache = cache | |
// TODO auto-allocate new buffer when it fills |
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
jeff@ta00491-Jeff ~/esp/hello_world $ make monitor | |
fatal: Not a git repository: /home/ivan/esp-idf/.git/modules/components/aws_iot/aws-iot-device-sdk-embedded-C | |
MONITOR | |
--- idf_monitor on /dev/ttyUSB1 115200 --- | |
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- | |
ets Jun 8 2016 00:22:57 | |
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) | |
configsip: 0, SPIWP:0xee | |
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 |
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
#!/usr/bin/env bash | |
wget http://mything.com/mything.tgz | |
tar xzf mything.tgz | |
cd mything | |
make all; make test; sudo make install | |
echo -e '#!/usr/bin/env bash\ninsmod mything.so' > /etc/rc.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
/* | |
WiFi Web Server | |
A simple web server that shows the value of the analog input pins. | |
using a WiFi shield. | |
This example is written for a network using WPA encryption. For | |
WEP or WPA, change the WiFi.begin() call accordingly. | |
Circuit: |
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
TC5->COUNT16.CTRLA.reg &= ~TC_CTRLA_ENABLE; | |
while (TC5->COUNT16.STATUS.bit.SYNCBUSY); | |
TC5->COUNT16.CTRLA.reg = TC_CTRLA_SWRST; | |
while (TC5->COUNT16.STATUS.bit.SYNCBUSY); |
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 celery import Celery | |
app = Celery('tasks', broker='amqp://guest@localhost//') | |
@app.task | |
def add(x, y): | |
return x + y |
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
#!/bin/bash | |
FILES=`git ls-tree --name-only HEAD .` | |
MAXLEN=0 | |
IFS=$(echo -en "\n\b") | |
for f in $FILES; do | |
if [ ${#f} -gt $MAXLEN ]; then | |
MAXLEN=${#f} | |
fi | |
done |
NewerOlder