Skip to content

Instantly share code, notes, and snippets.

@zakcodez
zakcodez / net-client.js
Last active December 9, 2021 11:23 — forked from sid24rane/net.js
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
const net = require("net");
// creating a custom socket client and connecting it....
const client = new net.Socket();
client.connect({
port: 2222
});
client.on("connect", () => {
@bgauduch
bgauduch / multiple-repository-and-identities-git-configuration.md
Last active April 25, 2024 12:45
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@davps
davps / install-nodejs-on-raspberrypi-armv6.md
Last active March 20, 2024 23:42
Steps to install nodejs on Raspberry Pi B+ (armv6)

Steps to install nodejs v6.2 on Raspberry Pi B+ (armv6)

cd ~
wget http://nodejs.org/dist/v6.2.1/node-v6.2.1-linux-armv6l.tar.gz
tar -xzf node-v6.2.1-linux-armv6l.tar.gz
node-v6.2.1-linux-armv6l/bin/node -v

The last command should print v6.2.1.

Now you can copy it to /usr/local

@sid24rane
sid24rane / net.js
Last active February 7, 2024 08:05
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
server.on('close',function(){
console.log('Server closed !');
});
@RoganDawes
RoganDawes / read_serial.py
Created March 3, 2016 15:50
Simple python script to read two serial ports at the same time. Good for snooping on bidirectional comms!
#!/usr/bin/python3
import serial, time, sys, threading
from colorama import Fore, Style, init as colorama_init
colorama_init()
# lock to serialize console output
lock = threading.Lock()
@illusionfield
illusionfield / bookmarklet-syntax.js
Last active March 21, 2024 05:25
Translate Bookmarklets
/**
* Web browsers use URIs for the href attribute of the <a> tag and for bookmarks. The URI scheme, such as http:, file:, or ftp:, specifies the protocol and the format for the rest of the string.
* Browsers also implement a prefix javascript: that to a parser is just like any other URI.
* Internally, the browser sees that the specified protocol is javascript, treats the rest of the string as a JavaScript application which is then executed, and uses the resulting string as the new page.
*
* The executing script has access to the current page, which it may inspect and change.
* If the script returns an undefined type (rather than, for example, a string), the browser will not load a new page, with the result that the script simply runs against the current page content.
* This permits changes such as in-place font size and color changes without a page reload.
*/
@joefg
joefg / 8080.op
Created July 27, 2015 14:44
A list of all 8080 opcodes. Mirror of Textfiles (http://textfiles.com/programming/8080.op) for posterity
Summary of 8080 Instructions
------- -- ---- ------------
Abbreviations used in this Summary:
R Any of the 8-Bit registers A,B,C,D,E,H,L.
data Any 8-bit or 16-bit value.
PC Program Counter.
SP Stack Pointer.