Skip to content

Instantly share code, notes, and snippets.

@joelclermont
joelclermont / en.json
Created May 21, 2021 23:37
Custom translation for new password rule
{
"The :attribute must contain at least one uppercase and one lowercase letter.": "your translation for :attribute",
"The :attribute must contain at least one letter.": "your translation for attribute",
"The :attribute must contain at least one symbol.": "your translation for :attribute",
"The :attribute must contain at least one number.": "your translation for :attribute",
"The given :attribute has appeared in a data leak. Please choose a different :attribute.": "your translation for :attribute"
}

Keybase proof

I hereby claim:

  • I am joelclermont on github.
  • I am jclermont (https://keybase.io/jclermont) on keybase.
  • I have a public key ASCwkc8kvnPnNbE4WqtFTljjYNAIJ4R1uYWHkJzENjgb5go

To claim this, I am signing this object:

defmodule Metex.Worker do
def loop do
receive do
{sender_pid, location} ->
send(sender_pid, {:ok, temperature_of(location)})
_ ->
send(sender_pid, "Unknown message")
end
loop
@joelclermont
joelclermont / life-motto.txt
Created March 22, 2014 22:24
what could it say?
-----BEGIN PGP MESSAGE-----
Version: Keybase OpenPGP JS 0.0.1
Comment: https://keybase.io/crypto
wcBMAxrE93bgR/zlAQgAkLiAQglVUFSFp6Ri5cqV9fKwCOBtODIDg6xnH2cwrY1h
DBwd9Fb3wguh8jspPxJrkj3pJRXIEccGz8TPLxbWwpag7cghYYkXIE9GtbjMdp70
3CaEMeKUoLUWKEG+WjbiQVgUHCBTLgZflFttMiocaPfA52FumxNsWw65BRDESKa0
pPHNB1QlXbtTAxe4q0XeK355RVstGetmqgXP5WaXAsYb17PcUhPyaftqjRi0nErY
htonNW8MbYwgg9RUkjEjoilxpULZe0y5qwOxjM0aHj/ZC6indQdJbpb6sA2/3FIC
jjPKF5c4lE5bXvJl5xb+rpMAB3Ebkswp5y31pv0vU9LA8AFew2OEB4fB1HIbElP2

Keybase proof

I hereby claim:

  • I am joelclermont on github.
  • I am jclermont (https://keybase.io/jclermont) on keybase.
  • I have a public key whose fingerprint is 528C E785 B349 6ACC D058 190A 8DF7 0DFA 5E8A 0515

To claim this, I am signing this object:

@joelclermont
joelclermont / gist:5711265
Created June 5, 2013 02:46
No closing tag needed
<?php
echo 'test';
?>
<b> some HTML </b>
<?
echo "I'm done";
@joelclermont
joelclermont / gist:4666034
Created January 29, 2013 17:35
Putting random numbers in your random numbers and doing random byte math is really random, right? Wrong.
' Because we cannot use the default randomizer, which is based on the
' current time (it will produce the same "random" number within a
' second), we will use a random number generator to seed the
' randomizer.
' Use a 4-byte array to fill it with random bytes and convert it then
' to an integer value.
Dim randomBytes As Byte() = New Byte(3) {}
' Generate 4 random bytes.
@joelclermont
joelclermont / gist:3735026
Created September 17, 2012 00:56
using yepnope for twitter js and css with local fallback
function cssLoaded(href) {
var cssFound = false;
for (var i = 0; i < document.styleSheets.length; i++) {
sheet = document.styleSheets[i];
if (sheet['href'].indexOf(href) >= 0 && sheet['cssRules'].length > 0) {
cssFound = true;
}
};
@joelclermont
joelclermont / store-credit.c
Created April 7, 2011 02:24
naive C implementation
//
// main.c
// cj-store-credit
//
// Created by Joel Clermont on 4/6/11.
// Copyright 2011 Orion Group, LLC. All rights reserved.
//
#include <stdio.h>
#include <time.h>
@joelclermont
joelclermont / store-credit.vb
Created April 7, 2011 02:23
naive algorithm
Imports System.IO
Module Module1
Sub Main()
Dim startTime As DateTime = Now
Dim N As Integer 'number of test cases
Dim C As Integer 'amount of credit
Dim l As Integer 'number of items in store