Skip to content

Instantly share code, notes, and snippets.

View InFog's full-sized avatar
🤔
Thinking

Evaldo Bento InFog

🤔
Thinking
View GitHub Profile
function fuck() {
killall -9 $2;
if [ $? == 0 ]
then
echo
echo " (╯°□°)╯︵$(echo $2|flip &2>/dev/null)"
echo
fi
}
@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

@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.'''
@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/*
@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);}
@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
@OnesimusUnbound
OnesimusUnbound / quote.txt
Last active August 16, 2023 16:24
Programming Quotes
[T]he difference between a bad programmer and a
good one is whether he considers his code or his
data structures more important. Bad programmers
worry about the code. Good programmers worry about
data structures and their relationships.
-- Linus Torvalds
~~~
Clarity and brevity sometimes are at odds.
When they are, I choose clarity.
-- Jacob Kaplan-Moss

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.

@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"