Skip to content

Instantly share code, notes, and snippets.

View hedcler's full-sized avatar

Hedcler Morais hedcler

View GitHub Profile
@hedcler
hedcler / install-telegram.sh
Created October 31, 2016 11:25 — forked from makiftasova/install-telegram.sh
A simple (and silly) bash script to adding Telegram's desktop app to PATH which wirtten as a quick hack. Tested on Fedora 21
#!/bin/bash
# Author: Mehmet Akif TAŞOVA <[email protected]>
# A simple (and silly) bash script to adding Telegram's
# desktop app to PATH which wirtten as a quick hack
# Just put this script alongsite Telegram and Updater
# executables from Telegram's desktop app package
# then run this script as root user
# To downlaod Telegram's Linux desktop app
# you can visit: https://desktop.telegram.org/
#!/bin/sh
# Sublime Text 3 install with Package Control (last update: 3 March 2016)
#
# No need to download this script, just run it on your terminal:
#
# $ curl -L git.io/vwdbg | sh
#
# When you need to update Sublime Text, run this script again.
@hedcler
hedcler / UseCase-Template
Created April 15, 2016 23:00 — forked from fourcube/UseCase-Template
Markdown Template for describing Use Cases
Use Case 1: (Target) Title (Type)
=================================
**Primary Actor**: User
**Scope**: Software system
**Level**: Summary / User Goal
Main success scenario:
----------------------
1. ...
2. ...
#!/usr/bin/python
"""
Requirements:
- tinydb
"""
import os
import sys
import errno
import argparse
import tinydb
@hedcler
hedcler / application_supervisor.conf
Last active March 29, 2016 02:35
Supervisor: TornadoWeb + Virtualenv
[program:<application_name>]
process_name=APP_%(process_num)s
directory=/websites/<application_path>/
command=/websites/<application_path>/venv/bin/python app.py --port=%(process_num)s
startsecs=2
user=www
stdout_logfile=/websites/<application_path>/logs/out-%(process_num)s.log
stderr_logfile=/websites/<application_path>/logs/err-%(process_num)s.log
numprocs=4
numprocs_start=10000
# Sexy Solarized Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Customized for the Solarized color scheme by Sean O'Neil
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then TERM=gnome-256color; fi
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
BASE03=$(tput setaf 234)
BASE02=$(tput setaf 235)
BASE01=$(tput setaf 240)
@hedcler
hedcler / gist:e8284f6ffa819eb7f48a
Created July 18, 2014 23:34
Funções para calcular intervalo de tempo
<?php
function truncate($value) {
$parts = explode('.',$value);
return $parts{0};
}
function sum_the_time($time1, $time2) {
$seconds = 0;

This uses Twitter Bootstrap classes for CodeIgniter pagination.

Drop this file into application/config.

@hedcler
hedcler / list_collaborators.php
Created September 27, 2012 21:21
Wordpress_Listar_Autores
<?
function list_collaborators() {
global $wpdb;
$authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users ORDER BY display_name");
foreach($authors as $author) {
$author_name = get_the_author_meta('display_name', $author->ID);
echo "<li>" .
"<a href=\"".get_author_posts_url( $author->ID, $author_name ). "\">" .
$author_name .
@hedcler
hedcler / gist:3343731
Created August 13, 2012 20:01
Adicionando aba no Facebook
https://www.facebook.com/dialog/pagetab?app_id=XXXXXXXXX&display=popup&next=HTTPURL