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
; Make repeated hotkey uses work, each time closing and re-launching StepMania, and only re-showing the task bar when the game is manually closed (instead of using the hotkey to relaunch it). | |
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
#SingleInstance force ; automatically replace old instance of script when launched again | |
#MaxThreadsPerHotkey 999 ; allows multiple instances of the hotkey subroutine to run, each temporarily halting the previous |
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
SetDateCreatedToDateAdded () { SetFile -d "$(date -j -f '%Y-%m-%d %H:%M:%S' "$(mdls $1 | grep -w kMDItemDateAdded | awk '{print $3,$4}')" +"%m/%d/%Y %H:%M:%S")" $1; } |
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
<p> | |
This is the top of the page. Pretend there is a ton of content here. | |
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> | |
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> | |
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> | |
Here is the bottom. | |
Check out <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media">CSS media queries</a>. | |
</p> | |
<a href="#" class="back2top">Back to top<a> | |
<style> |
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
class Motor(object): | |
def __init__(self): | |
pass | |
motorA = Motor() | |
motorB = Motor() | |
motorC = Motor() | |
motorD = Motor() | |
Motor.__init__ = lambda: None | |
del Motor |
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
//https://raw.githubusercontent.com/seth10/watch/31f9083a07451147009f5e92a93645e02fa69217/14seg/14seg.ino | |
#include "Adafruit_LEDBackpack.h" | |
char *message = " Hello world! "; | |
Adafruit_AlphaNum4 alpha4; | |
void setup() { | |
alpha4.begin(); |
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 some stuff we'll need | |
from GroveDevices import Grove_Moisture_Sensor | |
from PiStorms_GRX import PiStorms_GRX | |
import numpy as np | |
import time | |
# create a sensor (on port BAA1), the PiStorms object, and an empty list to hold the data | |
sensor = Grove_Moisture_Sensor("BAA1") | |
psm = PiStorms_GRX() | |
data = [] |
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
history | awk '{ print $2; }' | sort | uniq | |
# | |
alias | |
br | |
bt | |
cat | |
cd | |
chmod | |
clear | |
cp |
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
- # Find the index of the blob with the most pixels. | |
- most_pixels = 0 | |
- largest_blob = 0 | |
- for i in range(len(blobs)): | |
- if blobs[i].pixels() > most_pixels: | |
- most_pixels = blobs[i].pixels() | |
- largest_blob = i | |
+ # Find the blob with the most pixels. | |
+ largest_blob = max(blobs, key=lambda b: b.pixels()) |
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 PiStorms import PiStorms | |
from TouchScreenInput import TouchScreenInput | |
from functools import partial | |
psm = PiStorms() | |
textbox = TouchScreenInput(psm.screen) | |
textbox.bind_led_on_func(partial(psm.led, 1, 255, 0, 0)) | |
textbox.bind_led_off_func(partial(psm.led, 1, *[0]*3)) | |
result = textbox.getInput() | |
psm.screen.showMessage(['Your answer', result['response']]) |
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
b=`grep homefolder /usr/local/mindsensors/conf/msdev.cfg | cut -d"=" -f2 | cut -c 2-` | |
for f in 'MSDriver.py' 'MSBrowser.py' 'psm_shutdown' 'swarmserver' 'pistorms-diag.sh'; do sudo ln -f $b/sys/$f /usr/local/bin/$f; done | |
chmod +x $b/sys/swarmserver $b/sys/pistorms-diag.sh $b/programs/addresschange | |
for f in 'rmap.py' 'rmapcfg.py' 'scratch.py' 'PiStorms.py' 'PiStormsCom.py' 'TouchScreenInput.py' 'mindsensorsUI.py' 'MS_ILI9341.py' 'mindsensors.py' 'MsDevices.py' 'LegoDevices.py' 'swarmclient.py'; do sudo ln -f $b/sys/$f /usr/local/lib/python2.7/dist-packages/$f; done | |
sudo rm -rf /var/www | |
sudo ln -s $b/www /var/www | |
sudo ln -f $b/sys/msdev.cfg /usr/local/mindsensors/conf/msdev.cfg | |
# skipping images, art, scratch, changing ownerships... programs are still only in /home/pi/PiStorms | |
for f in 'MSDriver.sh' 'MSBrowser.sh' 'MSWeb.sh' 'SwarmServer.sh'; do sudo ln -f $b/setup/$f /etc/init.d/$f; done | |
for f in 'MSDriver.sh' 'MSBrowser.sh' 'MSWeb.sh' 'SwarmServer.sh'; do chmod +x $b/setup/$f; done |
NewerOlder