Skip to content

Instantly share code, notes, and snippets.

View Mexidense's full-sized avatar
πŸ“—
"Stay hungry. Stay foolish"

Salvador Briones Mexidense

πŸ“—
"Stay hungry. Stay foolish"
View GitHub Profile
@rajinwonderland
rajinwonderland / memorySizeOf.js
Created March 4, 2020 01:06
Calculate Memory Size of a JS Object
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if (obj !== null && obj !== undefined) {
switch (typeof obj) {
case "number":
bytes += 8;
break;
case "string":
⭐️ feat: add beta sequence (new feature)
πŸ›  fix: remove broken confirmation message (bug fix)
♻️ refactor: share logic between 4d3d3d3 and flarhgunnstow (refactoring production code)
🌈 style: convert tabs to spaces (formatting, missing semi colons, etc; no code change)
πŸ” test: ensure Tayne retains clothing (adding missing tests, refactoring tests; no production code change)
πŸ˜’ chore: add Oyster build script (updating grunt tasks etc; no production code change)
πŸ“ docs: explain hat wobble (changes to documentation)
Sources:
https://seesparkbox.com/foundry/semantic_commit_messages
@ibrunotome
ibrunotome / laravel-ddd-approach.md
Last active August 25, 2023 23:25
A Domain Driven Design (DDD) approach to the Laravel Framework
/app
β”œβ”€β”€ /Application
|  β”œβ”€β”€ /Exceptions
|  β”œβ”€β”€ /Middlewares
|  β”œβ”€β”€ /Providers
|  β”œβ”€β”€ /Requests
β”œβ”€β”€ /Domain
|  β”œβ”€β”€ /MyDomainA
| | β”œβ”€β”€ /Contracts
@hardianlawi
hardianlawi / download_images.sh
Last active January 5, 2025 17:46
Bash script to download images based on a list of urls
# This script is used to download images given a list of urls
imgdir=$1
urllist=$2
mkdir $imgdir
while read p;
do
wget $p -P $imgdir
done < $urllist

Luhn test

The Luhn test is used by some credit card companies to distinguish valid credit card numbers from what could be a random selection of digits. Those companies using credit card numbers that can be validated by the Luhn test have numbers that pass the following test: Reverse the order of the digits in the number. Take the first, third, ... and every other odd digit in the reversed digits and sum them to form the partial sum s1 Taking the second, fourth ... and every other even digit in the reversed digits: Multiply each digit by two and sum the digits if the answer is greater than nine to form partial sums for the even digits Sum the partial sums of the even digits to form s2. If s1 + s2 ends in zero then the original number is in the form of a valid credit card number as verified by the Luhn test.

// Report on "stuck" ether in empty contracts
// https://github.com/ethereum/EIPs/issues/156
// Usage: node find-stuck-ether.js [startBlock] [endBlock] > report.txt
let Eth = require('ethjs');
let eth = new Eth(new Eth.HttpProvider('http://localhost:8545'));
let ethutil = require('ethereumjs-util')
async function main() {
@jgamblin
jgamblin / slackspotify.sh
Created April 19, 2017 01:10
A Script To Set Current Spotify Song As Slack Status
#!/bin/bash
APIKEY="From Here https://api.slack.com/custom-integrations/legacy-tokens"
SONG=$(osascript -e 'tell application "Spotify" to name of current track as string')
URLSONG=$(echo "$SONG" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
while true
do
curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22"$URLSONG"%22%2C%22status_emoji%22%3A%22%3Amusical_note%3A%22%7D" > /dev/null
sleep 60
done
@ankurk91
ankurk91 / github_gpg_key.md
Last active April 14, 2025 13:42
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) πŸ”

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active January 25, 2025 15:00
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*

@rxaviers
rxaviers / gist:7360908
Last active April 24, 2025 18:48
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue: