Skip to content

Instantly share code, notes, and snippets.

View franciscohanna92's full-sized avatar

Francisco Hanna franciscohanna92

View GitHub Profile
export const chaosTestStrings = (): void => {
const textNodes = getAllTextNodes(document.body);
for (const node of textNodes) {
const textNodeLength = node.textContent ? node.textContent.length : 0;
if (node.textContent === null) {
return;
}
if (node.parentElement instanceof Element) {
if (node.parentElement.dataset.originalText === undefined) {
@MauroDanielPenaloza
MauroDanielPenaloza / DataSetCaso3AlumnosCarreraLCC
Last active July 23, 2018 00:05
Data set de Caso 3 (Alumnos de la carrera LCC)
-- éste es un ejemplo
group: nombreDeNuevoGrupo
ALU = {
dni:number, nomAlu:string, dir:string, tel:string
1, 'Mauro Daniel', 'Santa Lucia', '123456'
2, 'Martin', 'Santa Lucia', '123456'
3, 'Juan', 'Santa Lucia', '123456'
4, 'Marcelo Silva', 'Santa Lucia', '123456'
5, 'javier', 'Santa Lucia', '123456'
group: Caso 2
Cli = {
DNI:number, Nya:string , Sexo:string, Edad:number, Dir:string , Tel:number, Zona:string
38498425 , 'Rita Pérez' , 'F' , 60 , 'Calle 123', 123 , 'Rivadavia'
34567890 , 'Juan Páez' , 'M' , 24 , 'Calle 234', 876 , 'Rivadavia'
29875321 , 'Martín Tents' , 'M' , 47 , 'Calle 567', 999 , 'Capital'
12345678 , 'María Hollens', 'F' , 19 , 'Calle 222', 254 , 'Santa Lucía'
}
@tony-gutierrez
tony-gutierrez / AWS_Single_LetsEncrypt.yaml
Last active March 7, 2024 11:29
AWS Elastic Beanstalk .ebextensions config for single instance free SSL using letsencrypt certbot and nginx. http://bluefletch.com/blog/domain-agnostic-letsencrypt-ssl-config-for-elastic-beanstalk-single-instances/
# Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too.
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready!
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
@andyshinn
andyshinn / composer.json
Last active February 18, 2024 12:05
Docker Compose PHP Composer Example
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}
@vctrfrnndz
vctrfrnndz / letteravatar.js
Created May 18, 2015 17:06
Generate SVG letter avatar
function drawCircle(text, size, color) {
var textSize = Math.ceil(size / 2.5);
var font = 'Proxima Nova, proxima-nova, HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif';
var colors = ["#1abc9c", "#16a085", "#f1c40f", "#f39c12", "#2ecc71", "#27ae60", "#e67e22", "#d35400", "#3498db", "#2980b9", "#e74c3c", "#c0392b", "#9b59b6", "#8e44ad", "#bdc3c7", "#34495e", "#2c3e50", "#95a5a6", "#7f8c8d", "#ec87bf", "#d870ad", "#f69785", "#9ba37e", "#b49255", "#b49255", "#a94136"];
var colorIndex = Math.floor((text.charCodeAt(0) - 65) % colors.length);
var finalColor = color || colors[colorIndex];
var template = [
'<svg height="' + size + '" width="' + size + '" style="background: ' + finalColor + '">',
'<text text-anchor="middle" x="50%" y="50%" dy="0.35em" fill="white" font-size="' + textSize + '" font-family="' + font + '">' + text.toUpperCase() + '</text>',
@denji
denji / nginx-tuning.md
Last active July 7, 2024 04:40
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.