Skip to content

Instantly share code, notes, and snippets.

View Lemmings19's full-sized avatar

Lemmings19

View GitHub Profile
@Lemmings19
Lemmings19 / translationNamingConvention.md
Last active March 21, 2024 01:49
i18next JS Translation Naming Convention

Naming Translation Keys

Our translation keys are broken down into three sections:

namespace:filename.string

  1. namespace provides a convenient grouping for translations or modules. Each namespace will get its own file full of translations.
  2. filename should match the current file name, unless it is generic and there is a real risk of overlap with another file in the same namespace.
  3. string should convey the meaning or purpose of the individual string being translated. It should make sense to a translator who does not understand code.
@Lemmings19
Lemmings19 / react-i18next-translation-tips.tsx
Last active July 30, 2021 20:37
React i18next Translation Tips
TRANSLATION TIPS
2021-07-26
// PREFACE:
// These are custom to the project I am working on. For you, these two references:
withTranslationLoaded
WithTranslationLoadedProps
// Should probably be:
withTranslation
WithTranslationProps
@Lemmings19
Lemmings19 / customer_discovery_interview_tips.mkd
Last active October 16, 2019 19:13
Customer Discovery Interview Tips

Pre

  1. Do your homework on the industry, the company, and the individual.
  2. Mindset - inquisitive/ask questions, listen, don't pitch, don't "sell", don't answer for them.
  3. Remember to invalidate your ideas; not just confirm them.

Intro

  1. Play the startup card, the student card, the indie card, etc.
  2. Appeal to the interviewee's ego/expertise.
@Lemmings19
Lemmings19 / mental_medicine.mkd
Last active October 14, 2019 19:47
mental medicine

Exercise is the best medicine. It clears the mind, dissipates doubts, and frees up anxieties. It also instills a certain level of confidence not found when sedentary. It helps with presence of mind; the ability to think in the present and not get caught up with doubts, fears, and "what if's".

But exercise alone isn't enough to solve all of our internal problems. Exercise alone can still be used to procrastinate and be irresponsible, ignoring and putting off important problems.

Another core of the best medicine a human can get is a certain type of social interaction. Not just any social interaction will do. It's incredibly effective for us to interact with other people whom we have a shared struggle, whatever that may be, and to discuss it. That discussion can be forced, but often it's best if it comes up organically. The topic can be brought up and that isn't detrimental, but it comes through natural discussion that it can really be discussed in a meaningful manner. This may take time. It most definitely re

@Lemmings19
Lemmings19 / learning_how_to_speak_math.mkd
Created October 14, 2019 19:32
learning how to speak math

Math. Maths. I swear to god that people who practice it don't give two shits if you understand what they're on about. It's a whole other language and yet it doesn't seem to be recognized as such. Ask someone who's into math a question and they'll shoot you back some indecipherable gibberish equation. wtf does x stand for in this context? a? A? w? This means jack shit without context or a pre-existing set of knowledge about the customs and practices of maths.

I'm going to try to decipher some of this crap. They're not making it easy. Go onto Wikipedia, try to start reading anything about math, and there's at least three new terms linked in the opening paragraph. Follow those links, and then each new link will spawn at least three new links... I'm sure there's a mathematical equation for this. For the rest of us, the equation is simple: this is bullshit.

This started when I was trying to read Wikipedia articles about machine learning and now I'm fucking here. These things have so much underlying knowled

@Lemmings19
Lemmings19 / composerInstall.mkd
Created October 12, 2019 02:17
Composer installation instructions.

IMPORTANT: In the following commands, replace /home/your_username/bin with the path to your current account's home directory (eg. /home/bob/bin). Using the ~ shorthand will result in a failure.

Posted October 11th, 2019. Visit Composer's download page for a more recent version.

The only part of this script that is different from what Composer gives you on their download page is --install-dir=/home/your_username/bin --filename=composer -- that's the part that will save you some hassle and make it easy to run Composer anywhere on your system.

Run the following to install Composer:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
@Lemmings19
Lemmings19 / apache-localhost-ssl-notes.mkd
Last active October 8, 2019 23:26
localhost apache self-signed ssl notes

To review the Apache config: (rename 000-default.conf to whatever yours is set to) cat /etc/apache2/sites-available/000-default.conf

To create the necessary certificates (you can choose any name you want for the file): sudo openssl req -x509 -nodes -days 9999 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt

Make sure to type the URL or IP of your site (eg localhost or 127.0.0.1 for the prompt Common Name (e.g. server FQDN or YOUR name) []:.

If this is just for testing, don't password protect anything without a good reason...

@Lemmings19
Lemmings19 / slugify.js
Created February 24, 2019 03:33 — forked from hagemann/slugify.js
Slugify makes a string URI-friendly
function slugify(string) {
const a = 'àáäâãåăæçèéëêǵḧìíïîḿńǹñòóöôœṕŕßśșțùúüûǘẃẍÿź·/_,:;'
const b = 'aaaaaaaaceeeeghiiiimnnnoooooprssstuuuuuwxyz------'
const p = new RegExp(a.split('').join('|'), 'g')
return string.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
.replace(/&/g, '-and-') // Replace & with 'and'
.replace(/[^\w\-]+/g, '') // Remove all non-word characters
@Lemmings19
Lemmings19 / sendy_error_instructions.md
Last active February 2, 2019 21:07
Sendy "unlicensed domain" Error Fix On Nginx

For me, this was caused because of the Nginx server configruation. I originally had:

server {
    listen       80;
    server_name 12.168.101.224 mydomain.com www.mydomain.com;

    # the rest of the config ...
    . . .
@Lemmings19
Lemmings19 / sendy_nginx_config.md
Last active February 2, 2019 21:12
Sendy Nginx Configuration 2018-07-11

Installing Sendy at https://mydomain.com/sendy, this worked for me:

Add this into your existing site configuration found at /etc/nginx/sites-available/mydomain.com:

    location /sendy {
        # covers /l, /t, and /w URLs.
        rewrite ^/sendy/(l|t|w)/([a-zA-Z0-9\/]+)$ /sendy/$1.php?i=$2&$args;
        # covers /subscribe and /unsubscribe URLs.
        rewrite ^/sendy/(u?n?subscribe)/(.*)$ /sendy/$1.php?i=$2&$args;