Skip to content

Instantly share code, notes, and snippets.

View AndersonFirmino's full-sized avatar
🐍
📜 🎼 🎮 🐧 🦆

Anderson Araujo AndersonFirmino

🐍
📜 🎼 🎮 🐧 🦆
View GitHub Profile
@AndersonFirmino
AndersonFirmino / sql.php
Created January 21, 2016 00:59
Class PHP / PDO
<?php
/*
+--------------------------------+
| !IMPORANTE! |
| Classe sem muitos comentarios. |
| Se tiver dúvidas, ler sobre |
| PDO (PHP Data Objects) e |
| Prepared Statements |
+--------------------------------+
Anderson Araujo (CoderN)
@AndersonFirmino
AndersonFirmino / install_pygame.sh
Created February 17, 2016 23:24 — forked from brousch/install_pygame.sh
A script to install Pygame 1.9.1 into a Python2.7 virtualenv on Ubuntu 12.04. Make sure you have activated the virtualenv before running this script or it will install Pygame system-wide.
#!/bin/sh
BASE_PATH=`pwd`
sudo apt-get build-dep python-pygame
sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev libv4l-dev
cd /usr/include/linux
sudo ln -s ../libv4l1-videodev.h videodev.h
cd $BASE_PATH
wget http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz
tar -xzf pygame-1.9.1release.tar.gz
cd pygame-1.9.1release
@AndersonFirmino
AndersonFirmino / toggle.html
Created February 29, 2016 23:09
Toggle Problem
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.0/css/bootstrap-toggle.min.css" rel="stylesheet">
</head>
<body>
<main class="container">
@AndersonFirmino
AndersonFirmino / 00.howto_install_phantomjs.md
Created March 3, 2016 21:29 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
import sys
def count_words(text_file):
file = open(textfile,'r+')
word_list = {}
for word in file.read().split():
if word not in word_list:
word_list[word] = 1
else:
@AndersonFirmino
AndersonFirmino / install-pygtk.sh
Created April 23, 2016 18:41 — forked from mehcode/install-pygtk.sh
Install pygtk inside of a virtualenv
# Ensure we're in a virtualenv.
if [ "$VIRTUAL_ENV" == "" ]
then
echo "ERROR: not in a virtual environment."
exit -1
fi
# Setup variables.
CACHE="/tmp/install-pygtk-$$"
@AndersonFirmino
AndersonFirmino / Config Postgresql to Python
Created May 5, 2016 20:20 — forked from lym/gist:456ec863d3fc3c63cab4
psycopg: Error: b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'
# Just install libpq-dev
$ sudo apt-get install libpq-dev
@AndersonFirmino
AndersonFirmino / velocity-plus.sh
Last active May 7, 2024 13:26
Programas que ajudam a melhorar desempenho Linux/Pc modestos
#!/bin/sh
# script para instalar programas que ajudam no desempenho.
echo "Esta de acordo em fazer o upgrade? (digite: ok e tecle enter se sim) "
read certeza
if [ "$certeza" = "ok" ]
then
sudo apt-get install zram-config -y
sudo apt-get install preload -y
sudo apt-get install prelink -y
@AndersonFirmino
AndersonFirmino / gerar_secret_key.py
Created June 1, 2016 14:42
Pequeno script Python para gerar secret keys.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2016-06-01 11:21:46
# @Author : Anderson Araujo ([email protected])
import os, binascii, sys, clipboard
def main():
desc = """
Gerador de SECRET KEY
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.