Skip to content

Instantly share code, notes, and snippets.

View pc-magas's full-sized avatar
🇬🇷
Souvlaki daisuki!!!!!

pc_magas pc-magas

🇬🇷
Souvlaki daisuki!!!!!
View GitHub Profile
#!/usr/bin/env python
# coding=utf-8
# -*- Mode: python; c-basic-offset: 4 -*-
def convert_into_binary(c):
# We return the binary of c as a STRING
# Each character of the string can be converted it into integer using python's int() function.
return bin(c)[2:]
def square_and_multiply(x,c,n):
@pc-magas
pc-magas / nstall2.sh
Created August 9, 2016 18:50
Instaall script
#!/bin/bash
#Path where all the files will be executed
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done