This file contains hidden or 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
// index.js | |
const http = require('http'); | |
const server = http.createServer((req, res) => { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello, World!\n'); | |
}); | |
server.listen(3000, () => { |
This file contains hidden or 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
%% Sensor logging(live from cloud) | |
cla; clear; clc; | |
m = mobiledev("Your phone"); | |
m.AngularVelocitySensorEnabled = 1; | |
m.OrientationSensorEnabled = 1; | |
m.AccelerationSensorEnabled = 1; | |
m.PositionSensorEnabled = 1; | |
m.SampleRate = 50; |
This file contains hidden or 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
%Complex number to find roots of | |
p = [3, 4]; | |
Roots(Magnitude(p), Argument(p), 3) | |
%Complex number magnitude | |
function mag = Magnitude(p) | |
mag = sqrt((p(1)^2)+(p(2)^2)); | |
end |
This file contains hidden or 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 | |
usage=" | |
Usage: | |
wall [options] [message] | |
Write a message to all users. | |
Options: | |
-n, --nobanner do not print banner |
This file contains hidden or 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
makefile_contents='project.analyze:\n\t./.handler.sh analyze\n\techo "- Done analyzing"\nproject.integrate:\n\t./.handler.sh integrate\n\techo "- Consolidated top entity"\nproject.clean:\n\tghdl --clean\n\techo "- Cleaned stack"\nwave.gen:\n\techo "- Dumping signals"\n\t./.handler.sh run\nwave.show:\n\techo "- Opening wave"\n\t./.handler.sh open\nproject.all: project.clean project.analyze project.integrate wave.gen wave.show' | |
touch ./Makefile | |
echo $makefile_contents > ./Makefile | |
wget https://gist.githubusercontent.com/Noe-Sanchez/c2b16bc110bb30555ad87be2c24c07c2/raw/64bba8a6a5a8e52962440e48002cfc4faef4c24c/handler.sh | |
mv ./handler.sh ./.handler.sh | |
chmod +x ./.handler.sh | |
rm "$0" |
This file contains hidden or 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
entity=$(cat ./VHLists | grep TOP | sed "s/TOP //" | sed "s/.vhd//") | |
case $1 in | |
analyze) | |
echo "- Analyzing design and testbench files..." | |
for file in $(cat ./VHLists | sed "s/TOP //g" | tr "\n" " "); do \ | |
ghdl -a $file \ | |
&& (echo "Hit $file") \ | |
|| (echo "! Error at $file" && exit 1); \ | |
done |
This file contains hidden or 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
call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged') | |
let mapleader='`' | |
nnoremap <leader>v <cmd>CHADopen<cr> | |
nnoremap <leader>z <cmd>COQnow<cr> | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
Plug 'ms-jpq/chadtree', {'branch': 'chad', 'do': 'python3 -m chadtree deps'} | |
Plug 'ms-jpq/coq_nvim', {'branch': 'coq'} |
This file contains hidden or 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
cla | |
clear | |
[X, Y, Z] = deal([]); | |
A = [0,0]; | |
B = [5,0]; | |
C = [5,5]; | |
D = [0,5]; | |
E = [-5,5]; |
This file contains hidden or 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
#Query users | |
usrs=$(w -h -s | sed 's/ .*/-/g' | tr -d '\n') | |
#Print them | |
Cyan='\033[1;36m' | |
NC='\033[0m' | |
printf "${Cyan}Users logged:\n$usrs ${NC}" | |
echo | |
#Send them |