Skip to content

Instantly share code, notes, and snippets.

View santiblanko's full-sized avatar
🎯
Focusing

santiblanko santiblanko

🎯
Focusing
View GitHub Profile
@santiblanko
santiblanko / temp_hum_fuzzifier_example.py
Created March 30, 2019 22:03 — forked from mvidalgarcia/temp_hum_fuzzifier_example.py
Example of fuzzy logic with skfuzzy library
import numpy as np
import skfuzzy as fuzz
CURRENT_TEMP = 15
CURRENT_HUM = 50
x_temp = np.arange(-20, 41, 1)
x_hum = np.arange(0, 101, 1)
x_sys = np.arange(12, 36, 1)
@santiblanko
santiblanko / README.md
Created September 3, 2018 16:56 — forked from brunogaspar/README.md
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Installation

@santiblanko
santiblanko / electron-packager-extra-resource.md
Created August 19, 2018 02:33 — forked from fodra/electron-packager-extra-resource.md
Command to add extra resources in your electron app

This is the example usage of electron-packager that I never found online anywhere else.

To add resource.exe and resource2.dll in the resource folder when you create an installer, this is how you do it with the --extra-resource commandline switch.

--extra-resource

electron-packager . --overwrite --asar --extra-resource="resource1.exe" --extra-resource="resource2.dll" --platform=win32 --arch=ia32 --icon=./frontend/dist/assets/icon.ico --prune=true --out=./build --version-string.ProductName='Hot Pan de sal'

within the backend code you can refer to the files as:

@santiblanko
santiblanko / iris-tensorflow-js.js
Created June 20, 2018 21:47 — forked from learncodeacademy/iris-tensorflow-js.js
Solving Iris with Tensorflow.js and Iris JSON dataset
import * as tf from "@tensorflow/tfjs"
import "@tensorflow/tfjs-node"
import iris from "./iris.json"
import irisTesting from "./iris-testing.json"
// convert/setup our data
const trainingData = tf.tensor2d(iris.map(item => [
item.sepal_length, item.sepal_width, item.petal_length, item.petal_width,
]))
const outputData = tf.tensor2d(iris.map(item => [
@santiblanko
santiblanko / install_lamp_16.sh
Created March 18, 2018 00:16 — forked from ankurk91/install_lamp_ubuntu.sh
Ubuntu 16.04 - PHP development (php 7.1, MySQL 5.7, apache 2.4)
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Ubuntu 16.04 Dev Server
# Run like - bash install_lamp.sh
# Script should auto terminate on errors
echo -e "\e[96m Adding PPA \e[39m"
sudo add-apt-repository -y ppa:ondrej/apache2
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
@santiblanko
santiblanko / tmux-cheatsheet.markdown
Created January 15, 2017 05:41 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

##Example Task: Make 2 parallel (simultaneous) async calls, then one async call when they've resolved##

##The Good Way: Promises##

//with bluebird library
var parallelCalls = [
  getUrl('/api/profile'),
  getUrl('/api/accounts')
];
//spread is like .then(), except it apply()s the array of responses as individual arguments
@santiblanko
santiblanko / Issues.md
Last active August 29, 2015 14:14 — forked from rclark/Issues.md

There are a bunch of reasons why this is convoluted, mostly in building the URL to make the request:

  1. You have to rely on an AJAX request, this example uses jQuery
  2. To make a GetFeatureInfo request, you must provide a BBOX for a image, and the pixel coordinates for the part of the image that you want info from. A couple of squirrely lines of Leaflet code can give you that.
  3. Output formats. The info_format parameter in the request. We don't know a priori which will be supported by a WMS that we might make a request to. See Geoserver's docs for what formats are available from Geoserver. That won't be the same from WMS to WMS, however.
  4. WMS services return XML docs when there's a mistake in the request or in processing. This sends an HTTP 200, which jQuery doesn't think is an error.
#!/bin/bash
#
# Install Postgres 9.1, PostGIS 2.0 and pgRouting on a clean Ubuntu 12.04 install (64 bit)
# updated to PostGIS 2.0.1
# basics
apt-get install python-software-properties
apt-add-repository ppa:sharpie/for-science # To get GEOS 3.3.3
# install the following pacakages