Skip to content

Instantly share code, notes, and snippets.

View ljvmiranda921's full-sized avatar
☀️

Lj Miranda ljvmiranda921

☀️
View GitHub Profile

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@ljvmiranda921
ljvmiranda921 / .travis.yml
Created February 4, 2018 07:15
YAML file for Travis build for LaTeX file continuous integration and automatic deployment
sudo: required
dist: trusty
before_install:
- openssl aes-256-cbc -K $encrypted_65b80f527c7e_key -iv $encrypted_65b80f527c7e_iv -in .dropbox_uploader.enc -out ~/.dropbox_uploader -d
- ./tlsetup.sh
script:
- make latex COMPILER=xelatex
- ./dropbox_uploader.sh upload _build/main.pdf ${TRAVIS_BRANCH}/main-latest.pdf
- ./dropbox_uploader.sh upload _build/main.pdf ${TRAVIS_BRANCH}/main-${TRAVIS_JOB_NUMBER}.pdf

Keybase proof

I hereby claim:

  • I am ljvmiranda921 on github.
  • I am ljvmiranda (https://keybase.io/ljvmiranda) on keybase.
  • I have a public key whose fingerprint is 376B DF4D EA41 70D5 B37B AAA9 6C14 1C78 7DF0 930A

To claim this, I am signing this object:

@ljvmiranda921
ljvmiranda921 / Makefile
Last active September 10, 2018 10:58
Contains a minimal workflow for compiling LaTeX documents
# A Simple Makefile for LaTeX
# Author: Lester James V. Miranda
# E-mail: ljvmiranda@gmail.com
# Default variables which can be edited via the terminal
BUILDDIR = _build
COMPILER = pdflatex
PROJECT = main
BIBLIOGRAPHY = bibliography
@ljvmiranda921
ljvmiranda921 / index.js
Created December 18, 2018 15:46
Cloud Function template for creating status badge indicators
const { Storage } = require("@google-cloud/storage");
/**
* Auto-generated from cloud-build-badge. To deploy this cloud function, execute
* the following command:
* gcloud functions deploy christmAIs \
* --runtime nodejs6 \
* --trigger-resource cloud-builds \
* --trigger-event google.pubsub.topic.publish
*
int counter = 0;
int mode = 1;
bool mode_1_state = LOW;
bool mode_2_state = LOW;
unsigned long lastModeTime = 0;
int speed = 1000;
int led1_pin = 0;
int led2_pin = 1;
@ljvmiranda921
ljvmiranda921 / README.md
Created July 7, 2017 11:52
Two spiral neural network using particle swarm optimization and differential evolution

Neural Network for Solving the Two-Spiral Problem

This is a simple implementation of a 2-M-1 neural network trained using different optimization algorithms in order to solve the two-spiral problem. The two-spiral problem is a particularly difficult problem that requires separating two logistic spirals from one another [1] [2].

Two Spiral Problem

Files Included:

Neural Network:

  1. twin_spiral_vanilla.m - the main file containing the neural network structure. From here, different functions are called.
  2. nnCostFunction.m - function that contains the feedforward and backpropagation methods for the neural network. Here, both the cost and the gradient is computed and returned back to the main function via a handling variable.
  3. randInitializeWeights.m - function that randomly initializes the weights of the neural network in order for it to break symmetry.
@ljvmiranda921
ljvmiranda921 / README.md
Last active October 25, 2020 06:32
Three layer neural network (I-H-H-O) with tanh activation function in the hidden layers and softmax cross-entropy in the output layer.

Implementing a multi-layer perceptron to solve the two-spiral problem

This utilizes a three-layer neural network (2 hidden layers with tanh and 1 output layer with softmax) to solve the two-spiral problem. Included in this gist is data_utils.py which has the method load_twin_spiral() in order to generate the data. All of the computations in the neural network (feedforward and backpropagation) are done using the numpy package.

Usage

If you wish to use the classes in this gist, simply import the module network and load the class:

from network import *
from data_utils import *
@ljvmiranda921
ljvmiranda921 / test_map_contract.py
Created September 12, 2018 07:50 — forked from abele/test_map_contract.py
Abstract Test or Contract Test with pytest
import pytest
def square(num):
return num * num
def recursive_map(f, _list):
"""Recusive map implementation."""
if not _list:
@ljvmiranda921
ljvmiranda921 / renderer.py
Last active July 27, 2021 22:52
QGIS method to export RAW image into rendered image
def export_as_rendered_image(layer, outfile):
"""Export a QGIS Layer as the rendered image
Usage
-----
Use this while working inside QGIS. As of now, I'm not sure
how to run this outside of QGIS. In addition, files are saved
in your home directory
..code-block:: python