Skip to content

Instantly share code, notes, and snippets.

View rodrigopmatias's full-sized avatar
🎯
Focusing

Rodrigo Pinheiro Matias rodrigopmatias

🎯
Focusing
  • Palmas, Tocantins, Brasil
View GitHub Profile
if [ $UID -eq 0 ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
PROMPT='%n %{${fg_bold[blue]}%}:: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} '
RPS1="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
#include <stdio.h>
#include <stdlib.h>
typedef struct _node node;
typedef node *node_ptr;
struct _node
{
int v;
node_ptr l;
function celery_reboot()
{
for n in $(seq 0 2)
do
ssh system@celery$n supervisorctl restart celery
sleep 5
done
}
function flower_reboot()
require 'savon'
def with_auth (action, message, display_log)
resource = "resource"
user = "username"
passwd = "password"
client = Savon.client do
wsdl "#{resource}?wsdl"
# -*- coding: utf-8 -*-
import zlib
import base64
def compress(data):
mdata = base64.b64encode(zlib.compress(data, 9))
for i in range(0, len(mdata), 64):
print(mdata[i:i + 64])
#!/bin/sh
# 1. Add the Spotify repository signing key to be able to verify downloaded packages
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886
# 2. Add the Spotify repository
echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list
# 3. Update list of available packages
sudo apt-get update
#!/bin/bash
if [ "$UID" == "0" ]; then
echo "deb http://www.bchemnet.com/suldr/ debian extra" > /etc/apt/sources.list.d/samsung-udf.list
wget http://www.bchemnet.com/suldr/pool/debian/extra/su/suldr-keyring_1_all.deb
dpkg -i suldr-keyring_1_all.deb
rm suldr-keyring_1_all.deb
apt-get update
#include <Arduino.h>
#define PIN_BTN 14
#define PIN_LED 13
#define MAX_TIMER 30
uint8_t counter;
enum state {
ON,
@rodrigopmatias
rodrigopmatias / japa-in-hard.c
Last active January 4, 2016 07:59
"Tradutor" de nomes para "Japonês"
#include <stdio.h>
const char * data[] = {
"ka", "tu", "mi", "te", "ku", "lu", "ji", "ri", "ki", "zu", "me", "ta", "rin", "to",
"mo", "no", "ke", "shi", "ari", "chi", "do", "ru", "mei", "na", "fu", "ra"
};
int main(int argc, char ** argv) {
int i, letter;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static const char *b64_codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int b64_encode_size(const char * base);
int b64_decode_size(const char * base);
int b64_encode(const char * base, char * dest);
int b64_decode(const char * base, char * dest);