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
[package] | |
name = "factorial" | |
version = "0.1.0" | |
authors = ["Richard do Nascimento Fagundes <richardnas_@outlook.com>"] | |
edition = "2018" | |
[lib] | |
crate-type = ["cdylib"] | |
[dependencies] |
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
#![feature(lang_items)] | |
#![no_std] | |
use core::panic::PanicInfo; | |
#[no_mangle] | |
pub extern "C" fn factorial(x: u32) -> u32 { | |
(1..).take_while(|&i| i <= x).product() | |
} |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
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
def hex_to_rgb(hex): | |
return ','.join(list( | |
map( | |
lambda x: str(int(hex[x:x+2], 16)), | |
range(0, len(hex), 2) | |
) | |
)) |
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
def rgb_to_hex(rgb): | |
return ''.join(list( | |
map( | |
lambda x: format(int(x), '02X'), | |
rgb.split(',') | |
) | |
)) |
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
# LIST PARTITIONS | |
fdisk -l image.img | |
sudo losetup --find --show image.img | |
sudo partprobe /dev/loop0 | |
sudo mount /dev/loop0p1 /mnt/img1 | |
sudo mount /dev/loop0p2 /mnt/img2 |
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
sudo mkdir -p /usr/local/bin/ | |
# kubectl | |
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl | |
chmod +x ./kubectl | |
sudo mv ./kubectl /usr/local/bin/kubectl | |
# minikube | |
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 | |
chmod +x ./minikube | |
sudo mv ./minikube /usr/local/bin/ |
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
curl -L -o firefox.tar.bz2 "https://download.mozilla.org/?product=firefox-nightly-latest-ssl&os=linux64&lang=en-US" | |
tar -xjf firefox.tar.bz2 | |
sudo mv firefox /opt/ | |
cat <<EOF >>firefox-nightly.desktop | |
[Desktop Entry] | |
Version=1.0 | |
Name=Firefox Nightly |
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
find . -name 'node_modules' -type d -prune -print -exec rm -rfv '{}' \; |
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 | |
user_setup(){ | |
sed -e '/PROMPT/ s/^#*/#/' -i $1 2> /dev/null | |
cat >> $1 <<EOF | |
# Find and set branch name var if in git repository. | |
function git_branch_name() | |
{ | |
echo $(git branch 2>/dev/null | grep '^*' | colrm 1 2) |
OlderNewer