Skip to content

Instantly share code, notes, and snippets.

View roelvan's full-sized avatar
🏠
Working from home

Roel Vaneyghen roelvan

🏠
Working from home
View GitHub Profile
@MikeRogers0
MikeRogers0 / backup-to-s3.sh
Last active May 19, 2020 15:33
A method of backing up your website to Amazon S3.
#!/bin/bash
## Email Variables
EMAILDATE=`date --date="today" +%y-%m-%d`
EMAIL="you@yourdomain.com"
SUBJECT="[servername] Backup Script Started! - "$EMAILDATE
EMAILMESSAGE="/tmp/emailmessage1.txt"
echo "Just to let you know that the backup script has started."> $EMAILMESSAGE
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 23, 2024 04:22
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@paulallies
paulallies / gist:0052fab554b14bbfa3ef
Last active November 12, 2023 23:00
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin <branch-name>
@WilliamIsted
WilliamIsted / Craft CMS Image Alt Text
Last active April 3, 2019 22:38
Craft CMS - Show image alt text if it has been set and isn't autogenerated
<img{% if image.title | kebab != image.slug %} alt="{{ image.title }}"{% endif %} src="{{ image.getUrl('thumb') }}">
Example Usage:
{% if entry.images | length %}
{% for image in entry.images %}
<img{% if image.title | kebab != image.slug %} alt="{{ image.title }}"{% endif %} src="{{ image.getUrl('thumb') }}">
{% endfor %}
{% endif %}

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@sintaxi
sintaxi / regions.txt
Last active March 28, 2022 02:12
Surge Regions
List of regions your project is served from when you deploy using surge.
yyz.surge.sh : 159.203.50.177 : CA : Toronto
jfk.surge.sh : 159.203.159.100 : US : New York
sfo.surge.sh : 138.197.235.123 : US : San Francisco
lhr.surge.sh : 46.101.67.123 : GB : London
ams.surge.sh : 188.166.132.94 : NL : Amsterdam
fra.surge.sh : 138.68.112.220 : DE : Frankfurt
sgp.surge.sh : 139.59.195.30 : SG : Singapore
@equinusocio
equinusocio / css_multiline_truncate.scss
Created February 14, 2017 10:56
CSS Multiline Truncate
$font-size: 26px;
$line-height: 1.4;
$lines-to-show: 3;
h2 {
display: block; /* Fallback for non-webkit */
display: -webkit-box;
max-width: 400px;
height: $font-size * $line-height * $lines-to-show; /* Fallback for non-webkit */
margin: 0 auto;
@roelvan
roelvan / readme.md
Last active May 28, 2017 11:48
Cheatsheet for Vietnamese Telex Keyboard Input. Can be added to Alfred for Mac.
  1. install cheatset: sudo gem install cheatset --no-ri --no-rdoc
  2. compile file: cheatset generate telex.rb
@psi-4ward
psi-4ward / auth.changePassword.js
Last active June 26, 2020 09:56
Feathers.js simple changePassword Service
const auth = require('@feathersjs/authentication');
const errors = require('@feathersjs/errors');
const bcrypt = require('bcryptjs');
const comparePasswords = (oldPassword, password) => new Promise((resolve, reject) => {
bcrypt.compare(oldPassword, password, (err, data1) => {
if(err || !data1) return reject();
return resolve();
});
});
@clayperez
clayperez / Code.gs
Created December 18, 2019 14:53
AUTO-Generate Unique IDs in Google Sheets
// AUTO GENERATE SIMPLE UNIQUE ID'S FOR NON-EMPTY ROWS
//
// Author: Carlos Perez, clayperez@gmail.com
//
// Purpose: This Google Sheets script fires when any cell is edited and
// inserts a random (reasonably unique) UID of ID_LENGTH length
// into the specified ID_COLUMN. For instance if the first column in the
// sheet specified by SHEETNAME is the column where you would like the
// UID injected, then ID_COLUMN should be 1.
//