This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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%}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct _node node; | |
typedef node *node_ptr; | |
struct _node | |
{ | |
int v; | |
node_ptr l; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function celery_reboot() | |
{ | |
for n in $(seq 0 2) | |
do | |
ssh system@celery$n supervisorctl restart celery | |
sleep 5 | |
done | |
} | |
function flower_reboot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'savon' | |
def with_auth (action, message, display_log) | |
resource = "resource" | |
user = "username" | |
passwd = "password" | |
client = Savon.client do | |
wsdl "#{resource}?wsdl" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#define PIN_BTN 14 | |
#define PIN_LED 13 | |
#define MAX_TIMER 30 | |
uint8_t counter; | |
enum state { | |
ON, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); |
NewerOlder