Skip to content

Instantly share code, notes, and snippets.

View zomars's full-sized avatar
🙏
Never stop learning

Omar López zomars

🙏
Never stop learning
View GitHub Profile
@zomars
zomars / generate-vertical-sprite-from-video.sh
Last active March 3, 2023 18:24 — forked from vvo/video-snapshots-sprites.sh
generate a vertical sprite sheet from video file
# fps=10
ffmpeg -i video.mp4 -f image2 -vf fps=fps=10 img%03d.jpg
# vertical sprite
files=$(ls img*.jpg | sort -t '-' -n -k 2 | tr '\n' ' ')
convert $files -append output.jpg
# references:
# http://www.imagemagick.org/script/command-line-options.php#append
# http://www.imagemagick.org/script/command-line-options.php#resize
@zomars
zomars / [slug].js
Created April 6, 2021 20:43 — forked from agungjk/[slug].js
Crawler example on Vercel using Puppeteer and NextJS API routes
const puppeteer = require('puppeteer-core');
const cheerio = require('cheerio');
const chrome = require('chrome-aws-lambda');
export default async (req, res) => {
const slug = req?.query?.slug;
if (!slug) {
res.statusCode = 200
res.setHeader('Content-Type', 'application/json')
res.end(JSON.stringify({ id: null }))
@zomars
zomars / Magic Link 1
Created October 19, 2020 22:23 — forked from cosmos-sajal/Magic Link 1
Magic Link 1
@zomars
zomars / useRtDbData.js
Last active July 30, 2020 19:09 — forked from dsafreno/withDbData.js
Hook version of dsafreno's withDbData for RealTime Database subscribing in React.
import { useEffect, useRef, useState } from 'react';
import firebase from 'firebase/app';
import equal from 'deep-equal';
function filterKeys(raw, allowed) {
if (!raw) {
return raw;
}
const s = new Set(allowed);
return Object.keys(raw)
<?php
###############################################################
# cPanel Subdomains Creator 1.1
###############################################################
# Visit http://www.zubrag.com/scripts/ for updates
###############################################################
#
# Can be used in 3 ways:
# 1. just open script in browser and fill the form
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<style>
.square,
.landscape { visibility: hidden; }
.portrait { visibility: visible; }
@media (min-aspect-ratio: 1/1) {
.portrait,
.landscape { visibility: hidden; }
.square { visibility: visible; }
@zomars
zomars / encounterGradient.css
Last active February 18, 2016 00:53 — forked from anonymous/my.css
CSS Gradient Animation
background: linear-gradient(1deg, #a24bcf, #cf4b4b, #c0cf4b, #52cf4b, #52cf4b, #4bc5cf, #4b79cf);
background-size: 1400% 1400%;
-webkit-animation: encounterGradient 30s ease infinite;
-moz-animation: encounterGradient 30s ease infinite;
-o-animation: encounterGradient 30s ease infinite;
animation: encounterGradient 30s ease infinite;
@-webkit-keyframes encounterGradient {
    0%{background-position:50% 0%}
    50%{background-position:51% 100%}
    100%{background-position:50% 0%}
@zomars
zomars / snippet.js
Last active August 29, 2015 14:16 — forked from necolas/snippet.js
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],