Skip to content

Instantly share code, notes, and snippets.

@furudean
furudean / ps1.sh
Created January 17, 2019 14:58
Cute PS1
#!/bin/bash
export PS1="\[\e[31m\]♥\[\e[m\] \w "
@furudean
furudean / checkDigitEAN13.js
Last active June 26, 2024 16:03
Generate EAN13 check digit
/**
* Generates a check digit from a partial EAN13.
*
* https://www.gs1.org/services/how-calculate-check-digit-manually
*
* @param {string} barcode - 12 digit EAN13 barcode without the check digit
*/
function checkDigitEAN13(barcode) {
const sum = barcode.split('')
.map((n, i) => n * (i % 2 ? 3 : 1)) // alternate between multiplying with 3 and 1
@furudean
furudean / aws-profile
Last active December 7, 2018 15:06
Over-engineered set AWS_PROFILE
#!/bin/bash
aws-profile () {
local current=$AWS_PROFILE
local new
if (( $# == 0 )) ; then
declare suggest=("profile1" "profile2" "profile3" "profile4")
echo -e "\nselect a new profile\ncurrent: \x1b[33m\"$current\"\x1b[0m"
new=$(printf "%s\n" "${suggest[@]}" | fzf --height 5)
else
import os
import random
import requests
import tweepy
import PIL
from PIL import Image
from PIL import ImageColor
from PIL import ImageFile
# keys