tar -czvf name-of-archive.tar.gz /path/to/directory-or-file
tar -xf name-of-archive.tar.gz outdir/
# A program to make an image as a square maintaining aspect ratio and fill white spaces for extra space. | |
# I used this for instagram posts | |
from PIL import Image | |
import os | |
from pillow_heif import register_heif_opener | |
register_heif_opener() | |
# find largest width and length |
#include <stdio.h> | |
#include <stdlib.h> | |
int main() { | |
int row, col; | |
printf("enter row and col:"); | |
scanf("%d %d", &row, &col); | |
int **mat; | |
mat = calloc(row, sizeof(int *)); |
def binary_search(arr, low, high, number): | |
if high >= low: | |
mid = (high + low) // 2 | |
if arr[mid] == number: | |
return mid | |
elif arr[mid] > number: | |
return binary_search(arr, low, mid - 1, number) | |
else: | |
return binary_search(arr, mid + 1, high, number) | |
else: |
#!/bin/bash | |
set -e | |
INSTALLER_URL="http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz" | |
tmpdir=$(mktemp -d) | |
mkdir -pv $tmpdir | |
echo "Cding into temp directory $tmpdir" | |
cd $tmpdir |
# A program to check if the compiler passed | |
# is a Mingw-w64 based compiler. | |
import os | |
import subprocess | |
import argparse | |
import sys | |
def is_mingw(CC): |
import sys | |
normal_headers = [ | |
"absolute.h", | |
"c-ctype.h", | |
"c-dir.h", | |
"c-errno.h", | |
"c-fopen.h", | |
"c-limits.h", | |
"c-memstr.h", | |
"c-minmax.h", |
# Works on Manim Community Edition v0.15.0 | |
from manim import * | |
from manim.opengl import * | |
import textwrap | |
class InlineFullScreenQuad(Scene): | |
def construct(self): | |
surface = FullScreenQuad( | |
self.renderer.context, | |
textwrap.indent(""" |
def no_common_element_list(a,b): | |
return set(a) - set(b) == set(a) and set(b) - set(a) == set(b) |