https://github.com/pulls?user=matrix-hacks replace matrix-hacks with your own
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
# Steps to build and install tmux from source. | |
# Takes < 25 seconds on EC2 env [even on a low-end config instance]. | |
VERSION=2.6 | |
sudo yum -y remove tmux | |
sudo yum -y install wget tar libevent-devel ncurses-devel | |
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz | |
tar xzf tmux-${VERSION}.tar.gz | |
rm -f tmux-${VERSION}.tar.gz | |
cd tmux-${VERSION} |
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
#include <SimpleTimer.h> | |
SimpleTimer timer; | |
int outPin = 9; // output pin (relay) | |
int inPin = 8; // choose the input pin (for a pushbutton) | |
int outVal = LOW; | |
int val = 0; // variable for reading the pin status | |
int prevVal = 0; |
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
root@fireplace:~# cat server.js | |
var fs = require('fs'); | |
var http = require('http'); | |
const PORT=80; | |
function write(file, content) { | |
try {fs.writeFileSync(file, content)} | |
catch (err) {console.error(err.message)} | |
} |
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 | |
# Generates a PDF from a barcode string | |
# in the dimensions expected for a Keyport Barcode Insert | |
# https://www.mykeyport.com/barcode-insert | |
# You may need to set SYMBOLOGY and/or remove -c (checksum) | |
# depending on which barcode you're creating | |
SIZE="1.3x0.35" | |
UNITS="in" | |
SYMBOLOGY=${SYMBOLOGY:-"39"} | |
CODE="$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
#!/bin/bash | |
set -e | |
DOCSET_NAME="MatrixJSSDK" | |
cat <<EOF > docset-config.json | |
{ | |
"docset" : { | |
"name": "$DOCSET_NAME", | |
"icon": "scripts/icon.png" | |
} | |
} |
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
const { Puppet } = require("matrix-puppet-bridge"); | |
const puppet = new Puppet('./config.json'); | |
puppet.startClient().then(()=>{ | |
let client = puppet.getClient(); | |
const getAvatarUrlForMatrixUser = (uid) => { | |
client.getProfileInfo(uid, 'avatar_url').then(({avatar_url})=>{ | |
if (avatar_url) { | |
console.log('has avatar url', avatar_url); |
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
'use strict'; | |
var width = 300; | |
var height = 300; | |
var radius = Math.min(width, height) / 2; | |
var donutWidth = 75; | |
var color = d3.scaleOrdinal(d3.schemeCategory20b); | |
var svg = d3.select('#chart') | |
.append('svg') | |
.attr('width', width) | |
.attr('height', height) |
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
const { Puppet } = require("matrix-puppet-bridge"); | |
const puppet = new Puppet('./config.json'); | |
puppet.startClient().then(()=>{ | |
let client = puppet.getClient(); | |
client.on('sync', (state) => { | |
if ( state === 'PREPARED' ) | |
console.log(client.store.accountData['m.direct'].event.content); | |
}); | |
}); |
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
Tracing from matrix-appservice-imessage on down through the turtle stack: | |
The call bridge.run(port, config) makes the server listen: | |
https://github.com/kfatehi/matrix-appservice-imessage/blob/master/index.js#L181 | |
bridge.run, as defined in matrix-appservice-bridge, calls `appService.listen(port)`: | |
https://github.com/matrix-org/matrix-appservice-bridge/blob/master/lib/bridge.js#L253 |