Skip to content

Instantly share code, notes, and snippets.

View josejaguirre's full-sized avatar
🤺
Programming

José Aguirre josejaguirre

🤺
Programming
View GitHub Profile
@josejaguirre
josejaguirre / One Dark.icls
Created September 21, 2017 12:45
Intellij Atom One Dark theme
<scheme name="One dark" version="142" parent_scheme="Darcula">
<option name="LINE_SPACING" value="1.2" />
<option name="EDITOR_FONT_SIZE" value="14" />
<option name="EDITOR_FONT_NAME" value="Menlo" />
<colors>
<option name="ADDED_LINES_COLOR" value="98c379" />
<option name="CARET_COLOR" value="528bff" />
<option name="CARET_ROW_COLOR" value="2c323b" />
<option name="CONSOLE_BACKGROUND_KEY" value="282c34" />
<option name="DELETED_LINES_COLOR" value="e06c75" />
@josejaguirre
josejaguirre / socket-cheatsheet.js
Created September 21, 2017 19:50 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@josejaguirre
josejaguirre / socket-cheatsheet.js
Created September 21, 2017 19:50 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@josejaguirre
josejaguirre / client.js
Created September 21, 2017 20:18 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@josejaguirre
josejaguirre / connect.py
Last active September 25, 2017 13:11
Cadena de conexión para Flask & SQL Alchemy
import urllib
import pyodbc
from flask import Flask, request, jsonify
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
# Cadena de conexión
string_connection = "DRIVER={SQL Server};Database=DATABASE_NAME;SERVER=SERVER_NAME;UID=USER;PWD=PASSWORD"
string_connection = urllib.parse.quote_plus(string_connection)
string_connection = "mssql+pyodbc:///?odbc_connect=%s" % string_connection
@josejaguirre
josejaguirre / README.md
Created September 27, 2017 18:55 — forked from jonathantneal/README.md
SASS @font-face mixin

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@josejaguirre
josejaguirre / sawtooth-default-multi.yaml
Created October 16, 2020 03:54 — forked from samanshahmohamadi/sawtooth-default-multi.yaml
Hyperledger Sawtooth configuration to setup a network with multiple validators.
# Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@josejaguirre
josejaguirre / sawtooth-default-multi.yaml
Created October 16, 2020 03:54 — forked from samanshahmohamadi/sawtooth-default-multi.yaml
Hyperledger Sawtooth configuration to setup a network with multiple validators.
# Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@josejaguirre
josejaguirre / install-firacode.sh
Created January 25, 2021 01:39 — forked from nikhita/install-firacode.sh
How to install FiraCode font on Linux
mkdir -p ~/.local/share/fonts
for type in Bold Light Medium Regular Retina; do wget -O ~/.local/share/fonts/FiraCode-$type.ttf "https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-$type.ttf?raw=true"; done
fc-cache -f
const Eureka = require('eureka-js-client').Eureka;
const eurekaHost = (process.env.EUREKA_CLIENT_SERVICEURL_DEFAULTZONE || '127.0.0.1');
const eurekaPort = 8761;
const hostName = (process.env.HOSTNAME || 'localhost')
const ipAddr = '172.0.0.1';
exports.registerWithEureka = function(appName, PORT) {
const client = new Eureka({
instance: {