Skip to content

Instantly share code, notes, and snippets.

View andres-root's full-sized avatar
🎯
Focusing

Andrés Luján andres-root

🎯
Focusing
View GitHub Profile
@andres-root
andres-root / prettify.js
Created July 13, 2022 19:13
javascript - prettify
/*
Make the function more readable and maintainable
*/
function doStuff(text) {
const lowerCased = text.toLocaleLowerCase();
const words = lowerCased.split(' ');
words.reverse();
const trimmedWords = [];
@andres-root
andres-root / order_conf.html
Created November 18, 2021 18:56 — forked from LowerDeez/order_conf.html
Django. Send mail with custom html template and context
<!DOCTYPE html>
<html>
<body>
<br>
<h2>Thank you for your order {{ order.full_name }}</h2>
<h3>Your Order ID: {{ order.short_uuid }}</h3>
<h3>Shipping Details:</h3>
@andres-root
andres-root / accessibility-utils-trap-focus.js
Created October 23, 2020 00:15 — forked from hagata/accessibility-utils-trap-focus.js
Object based accessibility-utils file for managing and traping focus within a given dialog or modal box. Also includes a handy escape handler.
const accessibilityUtils = {
/**
* string list of selectors that are valid types that can be focused on.
* Used in querySelectorAll to create a NodeList of child elements within
* intended element to trap focus (the parent)
*/
focusableElements: 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',
/**
* Local context for mounting Nodes to be referenced when the handler is
@andres-root
andres-root / client.c
Created September 15, 2018 02:45 — forked from suyash/client.c
TCP echo client-server in C
#include <arpa/inet.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
int main() {
const char* server_name = "localhost";
const int server_port = 8877;
@andres-root
andres-root / squash-commits.sh
Created June 1, 2018 16:12 — forked from jbub/squash-commits.sh
git squash last two commits into one
git rebase --interactive HEAD~2
# we are going to squash c into b
pick b76d157 b
pick a931ac7 c
# squash c into b
pick b76d157 b
s a931ac7 c
@andres-root
andres-root / resources.md
Created December 15, 2017 01:09 — forked from iam1980/resources.md
Shadow Brokers EQGRP Lost in Translation resources
{
"491289025" : "ijinshan-kappmarket://",
"301521403" : "fb103361823069955://",
"492178411" : "ils492178411://",
"346142396" : "fb234434003713://",
"310633997" : "whatsapp://",
"370614765" : "com.condenet.newyorker://",
"325058491" : "rnmddisco://",
"382952264" : "epichttp://",
"477048487" : "predictwind://",
var canvas = null;
var context = null;
var frameRate = 1000/30;
var frame = 0;
var assets = ['https://www.udacity.com/media/js/standalone/libs/gamedev_assets/robowalk/robowalk00.png',
'https://www.udacity.com/media/js/standalone/libs/gamedev_assets/robowalk/robowalk01.png',
'https://www.udacity.com/media/js/standalone/libs/gamedev_assets/robowalk/robowalk02.png',
'https://www.udacity.com/media/js/standalone/libs/gamedev_assets/robowalk/robowalk03.png',
'https://www.udacity.com/media/js/standalone/libs/gamedev_assets/robowalk/robowalk04.png',
'https://www.udacity.com/media/js/standalone/libs/gamedev_assets/robowalk/robowalk05.png',
@andres-root
andres-root / 0_reuse_code.js
Created April 12, 2014 08:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
{
"3513": {
"average_increase": -24.7,
"total_made": 137,
"data": {
"1819434": {
"lease_signed": null,
"first_seen": "2013-07-10",
"resident_rent": null,
"unit_name": null