Skip to content

Instantly share code, notes, and snippets.

View yefriddavid's full-sized avatar
🎯
Focusing

Jeffrey David Rios yefriddavid

🎯
Focusing
  • Traze Software
  • Buenos Aires
View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 18, 2024 18:38
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
anonymous
anonymous / app.js
Created August 21, 2013 22:08
Estos son los componentes del aplicativo que controla nuestro sistema de switch por relay. @espumalab
var express = require('express')
, app = express()
, server = require('http').createServer(app)
, io = require('socket.io').listen(server)
, fs = require('fs')
, path = require('path')
, gpio = require('rpi-gpio')
server.listen(8000);
@ruckus
ruckus / Gemfile
Last active January 25, 2020 14:27
Example controller for a SOAP Endpoint for Quickbooks Web Connector (QWC)
# QBD Integration
gem "wash_out", "0.9.0"
gem 'qbxml', '~> 0.1.5'
@d-smith
d-smith / soap1.go
Created June 1, 2015 20:10
build up of soap parsing in golang
package main
import (
"encoding/xml"
"fmt"
)
var payload = `
<ns:workItem>
<typ:correspondenceCount>10</typ:correspondenceCount>
@iamralch
iamralch / sshtunnel.go
Last active August 21, 2024 05:15
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"
@XoseLluis
XoseLluis / es6ProxiesAndGetTrap.js
Last active December 13, 2021 10:10
ES6 proxies and method interception, 2 different ways of setting your get trap
// http://deploytonenyures.blogspot.fr/2015/11/es6-proxies-part-ii.html
//to run it in node.js 4 it should be just this flag: --harmony_proxies
//but does not seem to work, so run it in Firefox
var cat = {
name: "Kitty",
method1: function(msg){
console.log("cat: " + this.name + ", method1 invoked with msg: " + msg);
this.method2(msg);
},
sudo su -
# Kernels older than 3.10 lack some of the features required to run Docker containers.
uname -r
3.11.0-15-generic
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@tizmagik
tizmagik / getLastInMap.js
Created August 13, 2016 03:22
ES6 Last Item in Map()
// Since ES6 Map()'s' retain their order of insertion, it can sometimes be useful to get the last item or value inserted:
export const getLastItemInMap = map => Array.from(map)[map.size-1]
export const getLastKeyInMap = map => Array.from(map)[map.size-1][0]
export const getLastValueInMap = map => Array.from(map)[map.size-1][1]
// Obviously getLastKey and getLastValue can reuse getLastItem, but for maximum portability I opted for verbosity.
@vinzenz
vinzenz / dial-mysql-via-ssh.go
Created November 7, 2016 10:27
Using MySQL / MariaDB via SSH in Golang
package main
import (
"database/sql"
"fmt"
"net"
"os"
"github.com/go-sql-driver/mysql"
"golang.org/x/crypto/ssh"