Skip to content

Instantly share code, notes, and snippets.

View bronze's full-sized avatar
😎

Carlos Bronze bronze

😎
View GitHub Profile
@Princesseuh
Princesseuh / Image.astro
Last active January 30, 2022 04:13
Astro + eleventy-img
---
import Image from "@11ty/eleventy-img"
import { generateImage } from "utils.ts"
import { Markdown } from "astro/components"
const {
src,
alt,
caption,
options = {},
sizes = "",
@wittyprogramming
wittyprogramming / index.html
Created October 29, 2020 19:33
Netlify Form by using Alpine.js. Implement honeypot, Recaptcha, client-based validation, and AJAX (fetch) submission.
<form
hidden
name="contact"
method="POST"
data-netlify="true"
netlify-honeypot="bot-field"
data-netlify-recaptcha="true"
>
<label><input type="text" name="name" /></label>
<label> <input type="email" name="email" /></label>
@szepeviktor
szepeviktor / Wistia-download-videos.md
Last active November 15, 2024 04:51
Download Wistia videos - Please do not misuse it!

Download Wistia videos

  1. right-click on the playing video, select Copy link
  2. find Wistia video ID in the copied link e.g. wvideo=tra6gsm6rl
    • alternative: look for e.g. hashedId=tra6gsm6rl in the page source
  3. load http://fast.wistia.net/embed/iframe/ + video ID in your browser
  4. look for "type":"original" in the page source and copy the URL from the next line e.g. "url":"http://embed.wistia.com/deliveries/129720d1762175bcd8e06dcab926ec76ad38ff00.bin"
  • alternative: look for "type":"hd_mp4_video"
@onlurking
onlurking / terminal-setup.md
Last active February 19, 2024 18:01
Configs for zsh, oh-my-zsh, zsh-autosuggestions, zsh-syntax-highlighting and FZF

Setup

Terminal

Instal oh-my-zsh with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
@zanbaldwin
zanbaldwin / konami.js
Created May 21, 2019 18:08
Konami Code in Javascript/TypeScript
function konami(callback) {
var codes = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
position = 0;
document.addEventListener('keydown', function (event) {
if (event.keyCode === codes[position]) {
position++;
if (position === codes.length) {
position = 0;
callback();
}
const lunr = require('lunr')
require('lunr-languages/lunr.stemmer.support')(lunr)
require('lunr-languages/lunr.fr')(lunr)
require('./lunr.unicodeNormalizer')(lunr)
var idx = lunr(function () {
this.use(lunr.fr)
this.use(lunr.unicodeNormalizer)
...
@tzhenghao
tzhenghao / disable-macos-mouse-acceleration.sh
Created March 18, 2018 17:53
Disable MacOS mouse acceleration
#!/bin/bash
set -euo pipefail
# Author: Zheng Hao Tan
# Email: [email protected]
# This shell scripts disables mouse acceleration on a MacOS device.
echo 'The current mouse scaling value is:'
defaults read .GlobalPreferences com.apple.mouse.scaling
@mattes
mattes / og.txt
Last active May 7, 2022 01:53
Open Graph debugger
http://ogp.me/
https://moz.com/blog/meta-data-templates-123
https://search.google.com/structured-data/testing-tool
https://developers.facebook.com/tools/debug/og/object - https://developers.facebook.com/docs/reference/opengraph
https://cards-dev.twitter.com/validator - https://dev.twitter.com/cards/types
https://developers.pinterest.com/tools/url-debugger/ - https://developers.pinterest.com/docs/rich-pins/overview/
https://developer.linkedin.com/docs/share-on-linkedin
@tonysneed
tonysneed / Mac OS X: Open in Visual Studio Code
Last active June 14, 2024 04:16
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@zaygraveyard
zaygraveyard / viewport-units-ios.less
Last active April 9, 2019 18:44
LESS mixin to support vh and vw units on all iOS Safari versions. Based on an idea by Patrick Burtchaell's: https://gist.github.com/pburtchaell/e702f441ba9b3f76f587 and the SCSS version by Benjamin Morel's: https://gist.github.com/BenMorel/e9e34c08360ebbbd0634
/**
* Fix for vw, vh, vmin, vmax on iOS 7.
* http://caniuse.com/#feat=viewport-units
*
* This fix works by replacing viewport units with px values on known screen sizes.
*
* iPhone 6 and 6 Plus cannot run iOS 7, so are not targeted by this fix.
* Target devices running iOS 8+ will incidentally execute the media query,
* but this will still produce the expected result; so this is not a problem.
*