Skip to content

Instantly share code, notes, and snippets.

@Kentzo
Kentzo / gist:1515314
Created December 23, 2011 20:44
How to create Floppy Disk Image on Mac OS X for MS-DOS in vmware fusion
1. In terminal use "dd if=/dev/zero of=myfloppy.img bs=1024 count=1440" to create file with appropriate size
2. Attach a floppy device in VM setting. Select myfloppy.img
3. Use the "format a:" command to format disk
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active May 20, 2024 11:27
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@Frijol
Frijol / NodeHttpOnTessel.js
Last active August 29, 2015 14:01
Making an HTTP GET with Node http module on Tessel
var http = require('http');
console.log('http get...');
http.get("http://api.openweathermap.org/data/2.5/weather?id=5327684&units=imperial", function(res) {
console.log(res.statusCode);
if (res.statusCode == 200) {
var body = '';
res.on('data', function(chunk) {
body += chunk;
@johnnyman727
johnnyman727 / listening-client.js
Created September 23, 2014 19:57
Simple MQTT Server. Tessel acts as an MQTT client sending temperature data to a host
var mqtt = require('mqtt')
// Make sure to change this to the IP address of your MQTT server
, host = '192.168.128.204' // or localhost
client = mqtt.createClient(1883, host, {keepalive: 10000});
// Subscribe to the temperature topic
client.subscribe('temperature');
// When a temperature is published, it will show up here
client.on('message', function (topic, message) {
@branneman
branneman / client.js
Created November 8, 2014 14:51
Node.js TCP Socket - if either of them breaks, they'll keep trying to reconnect
var net = require('net');
//
// Client
//
function openSocket() {
var socket = net.connect(3e3);
socket.setKeepAlive(true);
socket.on('connect', onConnect.bind({}, socket));
@mike-casas
mike-casas / install-nvm-zsh.txt
Last active July 14, 2024 08:20
install nvm on mac with zsh shell
After install zsh
- brew update
- brew install nvm
- mkdir ~/.nvm
after in your ~/.zshrc or in .bash_profile if your use bash shell:
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh