Skip to content

Instantly share code, notes, and snippets.

View tete2soja's full-sized avatar
🦄
making some magic

Nicolas Le Gall tete2soja

🦄
making some magic
View GitHub Profile
@anotheruiguy
anotheruiguy / web-fonts-asset-pipeline.md
Last active June 24, 2024 22:11
Custom Web Fonts and the Rails Asset Pipeline

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.

@marcosnakamine
marcosnakamine / index.php
Created April 10, 2017 18:21
PHP - Google Invisible reCAPTCHA example
<html>
<head>
<title>reCAPTCHA demo: Simple page</title>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script>
function onSubmit(token) {
document.getElementById("demo-form").submit();
}
</script>
</head>
@Xartrick
Xartrick / santhacklaus_ctf_2019_writeups.md
Last active January 7, 2020 20:36
Santhacklaus CTF 2019 · Writeups
@revenkroz
revenkroz / download-geoipdb.sh
Last active July 22, 2024 15:16
Script to download MaxMind DB and extract it immediately
#!/bin/sh
export GEOIP_EDITION='GeoLite2-Country'
export GEOIP_LICENCE_KEY='secret_licence_key'
export GEOIP_TMP_FILE=geoip.tar.gz
curl -sSL "https://download.maxmind.com/app/geoip_download?edition_id=${GEOIP_EDITION}&license_key=${GEOIP_LICENCE_KEY}&suffix=tar.gz" > $GEOIP_TMP_FILE && \
tar -xzf $GEOIP_TMP_FILE --wildcards "*/${GEOIP_EDITION}.mmdb" --strip=1 && \
rm $GEOIP_TMP_FILE
  1. Generate the file:
$ awk 'BEGIN { for(c=0;c<10000000;c++) printf "<p>LOL</p>" }' > 100M.html
$ (for I in `seq 1 100`; do cat 100M.html; done) | pv | gzip -9 > 10G.boomgz
  1. Check it is indeed good: