Skip to content

Instantly share code, notes, and snippets.

View Suvink's full-sized avatar
🏢
Working from office

Suvin Nimnaka Suvink

🏢
Working from office
View GitHub Profile
// TODO: make `pages` optional and measure the div when unspecified, this will
// allow more normal document flow and make it easier to do both mobile and
// desktop.
import {
createContext,
useCallback,
useContext,
useEffect,
useMemo,
useRef,
@Suvink
Suvink / deploy.php
Created August 22, 2019 05:34 — forked from riodw/deploy.php
Deploy to Production Server with git using PHP
<?php
/**
* GIT DEPLOYMENT SCRIPT
*
* Used for automatically deploying websites via github or bitbucket, more deets here:
* https://gist.github.com/riodw/71f6e2244534deae652962b32b7454e2
* How To Use:
* https://medium.com/riow/deploy-to-production-server-with-git-using-php-ab69b13f78ad
*/
// The commands
@Suvink
Suvink / youtube-vimeo-url-parser.js
Created November 23, 2018 18:38 — forked from yangshun/youtube-vimeo-url-parser.js
YouTube Vimeo URL Parser
function parseVideo (url) {
// - Supported YouTube URL formats:
// - http://www.youtube.com/watch?v=My2FRPA3Gf8
// - http://youtu.be/My2FRPA3Gf8
// - https://youtube.googleapis.com/v/My2FRPA3Gf8
// - Supported Vimeo URL formats:
// - http://vimeo.com/25451551
// - http://player.vimeo.com/video/25451551
// - Also supports relative URLs:
// - //player.vimeo.com/video/25451551