Skip to content

Instantly share code, notes, and snippets.

View Sama-004's full-sized avatar

samanyu Sama-004

View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
id,organizationId,name,email,vat_number,address,createdAt,updatedAt
"c1e5d1c2-4db9-4a3a-9d85-4b92be56f784","1d76844b-ec06-48ad-b313-73597c8bf51a","Alpha Corp","contact@alphacorp.com","DE123456789","123 Alpha St, Berlin, Germany","2024-09-01T10:15:00Z","2024-09-11T10:15:00Z"
"e84a7c77-5c3b-4ad8-87ba-e97e51349f7e","1d76844b-ec06-48ad-b313-73597c8bf51a","Beta Inc","info@betainc.com","US987654321","456 Beta Ave, New York, USA","2024-08-15T09:30:00Z","2024-09-11T09:30:00Z"
"ab60d1d2-1234-4f9a-99d7-5bcd34ef9823","1d76844b-ec06-48ad-b313-73597c8bf51a","Gamma LLC","support@gammallc.com","FR334455667","789 Gamma Rd, Paris, France","2024-07-20T14:45:00Z","2024-09-11T14:45:00Z"
"f73e57db-b1c2-4c3e-9e5b-f4ed62e7d54c","1d76844b-ec06-48ad-b313-73597c8bf51a","Delta Solutions","contact@deltasolutions.com","IT556677889","987 Delta St, Rome, Italy","2024-06-10T12:00:00Z","2024-09-11T12:00:00Z"
"12a4c7b6-832b-47eb-b8ff-5b7a612c21b4","1d76844b-ec06-48ad-b313-73597c8bf51a","Epsilon Technologies","hello@epsilontechnologies.com","E
-- inserts a row into public.user_profiles with only id and user_id
create or replace function public.handle_new_user()
returns trigger
language plpgsql
security definer set search_path = ''
as $$
begin
insert into public.user_profiles (id, user_id, username)
VALUES (new.id, new.id, (new.raw_user_meta_data->>'username'));
return new;
Write a shell script to checks if name given is file or directory and if it is file then it should display content and if it is a directory then it should display the list.
Use: ls –al | grep “^d” ls –al | grep “^_”
Write a shell script to accept two filenames and check if both exits. If second file exists then append the content of first file to second file.
Write a shell script to examine all the number from 1 to 999 and display all those number whose sum of cube of the digit is equal to the number. e.g. 371 = 3*3*3+7*7*7+1*1*1
Write a shell script to create a command line calculator. e.g. input : mycal 5 + 5 Result : 10 , input : mycal 5 / 5
Write a shell script that that takes as command line input a number N and a Word. it then prints the word n times., one word per line
Write a shell script to take two numbers from command line and show result of dividing small number with bigger number. Also note that it should not accept zero or negative number. If user enter zero or ne
@Sama-004
Sama-004 / config
Created June 28, 2024 18:53
i3Status config
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
#include <bits/stdc++.h>
using namespace std;
#define nl cout << '\n'
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
typedef vector<int> vi;
@Sama-004
Sama-004 / script.js
Created May 22, 2024 08:44
Download view only pdf google drive
let jspdf = document.createElement( "script" );
jspdf.onload = function () {
let pdf = new jsPDF();
let elements = document.getElementsByTagName( "img" );
for ( let i in elements) {
let img = elements[i];
if (!/^blob:/.test(img.src)) {
continue ;
}
let canvasElement = document.createElement( 'canvas' );
{"theme":"catppuccin","themeLight":"serika","themeDark":"serika_dark","autoSwitchTheme":false,"customTheme":true,"customThemeColors":["#1e1e2e","#a6e3a1","#f5e0dc","#585b70","#181825","#cdd6f4","#f38ba8","#eba0ac","#f38ba8","#eba0ac"],"favThemes":[],"showKeyTips":true,"smoothCaret":"medium","quickRestart":"tab","punctuation":false,"numbers":false,"words":50,"time":15,"mode":"time","quoteLength":[1],"language":"english","fontSize":2,"freedomMode":false,"difficulty":"normal","blindMode":false,"quickEnd":false,"caretStyle":"default","paceCaretStyle":"default","flipTestColors":false,"layout":"default","funbox":"none","confidenceMode":"off","indicateTypos":"off","timerStyle":"mini","liveSpeedStyle":"off","liveAccStyle":"off","liveBurstStyle":"off","colorfulMode":false,"randomTheme":"off","timerColor":"main","timerOpacity":"1","stopOnError":"off","showAllLines":false,"keymapMode":"off","keymapStyle":"staggered","keymapLegendStyle":"lowercase","keymapLayout":"overrideSync","keymapShowTopRow":"layout","fontFamily":"J
@Sama-004
Sama-004 / .tmux.conf
Last active July 29, 2024 11:28
Added alacritty scroll
#works
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ',*256color*:smcup@:rmcup@'
#set -g default-terminal "alacritty"
set -g mouse on
set-option -ga terminal-overrides "xterm-256color:Tc"
#set-option -ga terminal-overrides ",alacritty:Tc"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
import=[
# uncomment the flavour you want below:
#"~/.config/alacritty/catppucin/catppuccin-latte.yml"
"~/.config/alacritty//catppuccin-mocha.toml"
# "~/.config/alacritty/catppuccin-frappe.toml"
# "~/.config/alacritty/catppuccin-macchiato.toml"
# "~/.config/alacritty/catppuccin-mocha.toml"
]
# Configuration for Alacritty, the GPU enhanced terminal emulator.