Skip to content

Instantly share code, notes, and snippets.

View mcspx's full-sized avatar

@mcspx mcspx

  • M STACK CO.,LTD.
View GitHub Profile
@mcspx
mcspx / lazy-load-puppeteer.js
Created October 2, 2019 20:53 — forked from schnerd/lazy-load-puppeteer.js
Lazy-loading content in Puppeteer
function wait (ms) {
return new Promise(resolve => setTimeout(() => resolve(), ms));
}
export default async function capture(browser, url) {
// Load the specified page
const page = await browser.newPage();
await page.goto(url, {waitUntil: 'load'});
// Get the height of the rendered page
@mcspx
mcspx / index.html
Created August 23, 2019 19:02
Toast Messages + Remove Animation
<div class="toast__container">
<div class="toast__cell">
<div class="toast toast--green">
<div class="toast__icon">
<svg version="1.1" class="toast__svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<g><g><path d="M504.502,75.496c-9.997-9.998-26.205-9.998-36.204,0L161.594,382.203L43.702,264.311c-9.997-9.998-26.205-9.997-36.204,0 c-9.998,9.997-9.998,26.205,0,36.203l135.994,135.992c9.994,9.997,26.214,9.99,36.204,0L504.502,111.7 C514.5,101.703,514.499,85.494,504.502,75.496z"></path>
</g></g>
</svg>
</div>
<div class="toast__content">
@mcspx
mcspx / d3-js-calendar-heatmap.markdown
Created March 18, 2019 17:31
D3.js calendar heatmap

D3.js calendar heatmap

D3.js calendar heatmap representing time series data is used to visualize tracked time over the past year, showing details for each of the days on demand.

Includes visualization of year, month, week and day overview with zoom for details-on-demand.

Inspired by github's contribution graph.

For more info see https://github.com/g1eb/calendar-heatmap

@mcspx
mcspx / gps.hpp
Created January 5, 2018 17:45 — forked from nazt/gps.hpp
gps.hpp
#include <Arduino.h>
#include "gnss.h"
GNSS gps;
float GPS_SEARCH_TIMEOUT_S = 40;
extern uint8_t LED;
// volatile char GNSS_data[58] = "";
char GNSS_data[58] = "";
String gps_data = "";
@mcspx
mcspx / python_opencv_camera_haar.py
Created November 4, 2017 04:29 — forked from radames/python_opencv_camera_haar.py
Example of Python with Opencv and camera face detection
import cv2
cap = cv2.VideoCapture(0)
cap.set(3, 640) #WIDTH
cap.set(4, 480) #HEIGHT
face_cascade = cv2.CascadeClassifier('/usr/local/Cellar/opencv/2.4.13/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier('/usr/local/Cellar/opencv/2.4.13/share/OpenCV/haarcascades/haarcascade_eye.xml')
while(True):
@mcspx
mcspx / Laravel PHP7 LEMP AWS.md
Created June 9, 2017 17:35 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip