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 / LaravelRecursiveBlade.php
Last active October 15, 2022 09:59
How to create a recursive list in a Blade. (Laravel)
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class TestController extends Controller
{
/**
* This is just a quick example of how to create a recursive list of items
@Lemmings19
Lemmings19 / prompt.sh
Last active January 9, 2022 23:05
Working Linux Terminal Prompt
# Example Prompt using this gist:
# 2022-01-09 23:00:50 user@host: ~/my-folder $
# Sets the scheme for the terminal prompt. Note that '##m' constitutes a colour code.
# Avoids several bugs, including the terminal input line-wrapping over the prompt.
# Includes the full date and time.
# In Ubuntu, add this to '~/.bashrc', then run 'source ~/.bashrc' and start a new terminal
# to apply the new prompt.
PS1='\D{%F %T} \[\033[01;32m\]\u\[\033[00m\]@\[\033[01;36m\]\h\[\033[00m\]: \[\033[01;34m\]\w\[\033[00m\] $ '
@Lemmings19
Lemmings19 / blackfire-osx-mamp-readme.md
Created April 13, 2017 22:41
Blackfire OSX MAMP setup:
@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 / readme.md
Created February 12, 2017 06:36
How to share a folder between Ubuntu inside VirtualBox (the guest) and Windows (the host)

For example:

I have a folder on my Windows installation named C:/shared_stuff.

I have Ubuntu running inside VirtualBox on my Windows installation.

I want to access that folder inside Ubuntu under the path /mnt/shared_stuff (this could be anything you like; it doesn't have to match the name of the folder in Windows).

  • Inside settings for the VM, go to Shared Folders.
  • Add a Machine Folder (or check Make Permanent).
@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;"