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 | |
VIDEO="${1:-test.mp4}" | |
GIF="${2:-test.gif}" | |
ffmpeg -ss 61.0 -t 2.5 -i "$VIDEO" -filter_complex "[0:v] fps=12,scale=w=480:h=-1,split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=new=1" "$GIF" | |
chafa "$GIF" |
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 | |
if [ "$(id -u)" -ne 0 ]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
USER=$(ls /home) | |
CHANNEL="$(echo $@ | awk -F '/' '{print $NF}')" |
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=$(ls /home) | |
mkdir -p /home/$USER/YouTube | |
for I in $(curl -s "https://www.youtube.com/feeds/videos.xml?channel_id=$1" | awk -F '"' '/watch/ {print $4}') | |
do | |
FORMATS=$(youtube-dl -F $I) | |
TITLE="$(youtube-dl --get-title $I)" |
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
//Code that scrapes webpages | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <iostream> | |
#include <string> | |
#include <fstream> | |
using namespace std; | |
string url; |
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> | |
#include <stdbool.h> | |
#define SIZE 999999 | |
#define WORD 255 | |
int n; | |
int m; |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string> | |
#include <iostream> | |
#include <thread> | |
#include <chrono> | |
#include <fstream> | |
#include <time.h> | |
#include <unistd.h> | |
using namespace std; |
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
//Raspberry pi configuration | |
#include <iostream> | |
#include <string> | |
#include <fstream> | |
#include <stdlib.h> | |
#include <stdio.h> | |
using namespace std; | |
string name; |
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
//Code that scrapes veekun for pokedex data and displays it to user | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <iostream> | |
#include <string> | |
#include <fstream> | |
#include <algorithm> | |
#include <time.h> | |
#include <ctype.h> |
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 <X11/Xlib.h> | |
#include <assert.h> | |
#include <unistd.h> | |
#define NIL (0) | |
Display *dpy = XOpenDisplay(NIL); | |
assert(dpy); | |
int blackColor = BlackPixel(dpy, DefaultScreen(dpy)); |
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
//Covariance achieved with classes | |
#include <math.h> //Needed for pow() function | |
class Covariance { | |
static int cycles = 5; //Should change based on frequency of data collection | |
double sum1 = 0, sum2 = 0, arr1[cycles], arr2[cycles], var1 = 1, var2 = 1; //Initialize | |
int counter = 0; | |
public: |
NewerOlder