Skip to content

Instantly share code, notes, and snippets.

View michaeljymsgutierrez's full-sized avatar
:octocat:
I'm just a developer for fun ⌨️

Chael Gutierrez michaeljymsgutierrez

:octocat:
I'm just a developer for fun ⌨️
View GitHub Profile
@michaeljymsgutierrez
michaeljymsgutierrez / .bashrc
Created November 18, 2018 11:15
Personal Bash Config
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@michaeljymsgutierrez
michaeljymsgutierrez / attendance.patch
Last active March 23, 2019 00:52
A super patch for my attendance
diff --git a/services/endpoints/attendance.js b/services/endpoints/attendance.js
index f5f5222..0f46fff 100644
--- a/services/endpoints/attendance.js
+++ b/services/endpoints/attendance.js
@@ -18,6 +18,112 @@ app.post("/api/attendance/import", (req, res) => {
let parse_line = string_data.replace(/(?:\r\n|\r|\n)/g, "<br/>");
let split_line = parse_line.split("<br/>");
split_line.splice(0, 1);
+ /**
+ * CG Patch Starts Here
https://drive.google.com/open?id=0ByrfnAdEiGXpMndIV3BlRkxJWG8
@michaeljymsgutierrez
michaeljymsgutierrez / gulpfile.js
Created July 30, 2018 00:29
Set of gulp useful tasks
var gulp = require('gulp');
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var sh = require('shelljs');
var pump = require('pump');
var uglify = require('gulp-uglify');
var webserver = require('gulp-webserver');
@michaeljymsgutierrez
michaeljymsgutierrez / index.html
Last active January 13, 2018 02:37
Site Maintenance
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #fff; background-color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #d3d3d3; text-decoration: none; }
</style>
@michaeljymsgutierrez
michaeljymsgutierrez / express2https.txt
Last active March 31, 2018 13:49
Express to Https
Exec in terminal
sudo certbot --authenticator webroot --webroot-path <path-to-webroot> --installer apache -d <your-domain>
sudo certbot certonly --webroot --webroot-path= <path-to-webroot> -d <your-domain>
var https = require('https');
var sslOptions = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem'),
};
https.createServer(sslOptions, app).listen(3000);
@michaeljymsgutierrez
michaeljymsgutierrez / Breakpoints.css
Last active March 13, 2018 01:24
Bootstrap 3 Break Points
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
@michaeljymsgutierrez
michaeljymsgutierrez / Fastboot_cmd.txt
Created October 5, 2017 01:14
Fastboot command lines for android
1. Flashing the recovery image:
fastboot flash recovery recovery.img
2. Flash the kernel and bootloader:
fastboot flash boot boot.img
3. Erase a partition:
fastboot erase cache
<video id="video" width="640" height="480" autoplay></video>
<button id="snap">Snap Photo</button>
<canvas id="canvas" width="640" height="480"></canvas>
<script>
/* { audio: true } */
/* Get camera access */
if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ video: true }).then(function(stream) {
@michaeljymsgutierrez
michaeljymsgutierrez / image-picker.js
Created July 26, 2017 14:39
Simple work around for picking image and converting to b64
/* Initialize options */
var options = {
quality: 50,
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 800,
targetHeight: 800,
popoverOptions: CameraPopoverOptions,