Skip to content

Instantly share code, notes, and snippets.

View InFog's full-sized avatar
🤔
Thinking

Evaldo Bento InFog

🤔
Thinking
View GitHub Profile
@vasanthk
vasanthk / System Design.md
Last active May 1, 2024 06:11
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?

Serving Flask under a subpath

Your Flask app object implements the __call__ method, which means it can be called like a regular function. When your WSGI container receives a HTTP request it calls your app with the environ dict and the start_response callable. WSGI is specified in PEP 0333. The two relevant environ variables are:

SCRIPT_NAME
The initial portion of the request URL's "path" that corresponds to the application object, so that the application knows its virtual "location". This may be an empty string, if the application corresponds to the "root" of the server.

@barraponto
barraponto / Copa2014.py
Last active May 20, 2016 02:32 — forked from fmasanori/Copa2014.py
Pythonic sum of 2014 World Cup spendings
# coding: utf-8
from urllib.request import urlopen
from xml.etree import ElementTree
class Budget(object):
'''2014 World Cup budget parser.'''
def __init__(self, data_url):
'''Parses XML from data_url.'''
@michellesanver
michellesanver / socials.md
Last active November 19, 2015 16:28
Conference socials in bars: How culture doesn't match comfort

I was hesitant as to whether or not to publish this, but in an act to create awareness in a community where some people, including me, are left uncomfortable and no one notices, I decided to go ahead. Feel free to share your experiences too, to further spread awareness in our community, because awareness is the first step.

I noticed that I started being more and more reserved the more events I went to rather than the other way around. This worried me and I was up until late hours thinking, why is that?

What happens at the events may be part of that, so here I'm sharing to create awareness. Bear in mind that this is only a handful of things that happened to me at conference socials, to give you an idea as to why I'm nowadays inclined to only hangout with the people I know, or skip the conference socials all together.

When you notice that behaviour from me remember that: It's not you, it's me, feel free to say hi but please understand why I may be a bit shy at first.

Disclaimer: I didn’t repor

function fuck() {
killall -9 $2;
if [ $? == 0 ]
then
echo
echo " (╯°□°)╯︵$(echo $2|flip &2>/dev/null)"
echo
fi
}
@InFog
InFog / proceduralphp.md
Last active March 23, 2023 08:15
PHP Procedural Framework Manifesto

Procedural PHP Manifesto

We are web site developers (a.k.a. webmasters) and we just want to get stuff done. We don't need Object Orientation and we don't need Design Patters and other boring and not easy to learn and understand stuff to get in our way to get our sites up and running.

And that's why our values are:

  1. Procedural Code over Object Orientation
  • No one actually needs OO to develop web applications
  • Classes with only static functions are ok, since it's just a way to keep functions in one place. And is still procedural
  1. Explicitly load what you need over autoloaders
@mathiasverraes
mathiasverraes / TestFrameworkInATweet.php
Last active May 23, 2022 12:28
A unit testing framework in a tweet.
<?php
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}
@h4cc
h4cc / Makefile
Created December 1, 2013 12:01
Very simple Makefile to deploy a existing symfony2 application. Using Doctrine ORM and MongoDB ODM for database. Inital usage: $ git clone https://exaple.com/project.git $ make permissions Deploying or Updating with database changes: $ make deploy $ make database
hello:
@echo "Hello! use other targets!"
deploy:
git reset --hard -q
git pull -q
rm -rf bin/
php composer.phar install --no-progress --no-dev -o --quiet
rm -rf app/cache/*
@aras-p
aras-p / preprocessor_fun.h
Last active April 28, 2024 15:25
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,