Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "bigint.h"
/* this library provides for a bigint type, which can hold numbers of an unlimited length.
You can add them together as well.*/
@thisivan
thisivan / .zshrc
Created February 11, 2011 22:07
Enable Vim mode in ZSH
# Enable Vim mode in ZSH
bindkey -v
autoload -U edit-command-line
zle -N edit-command-line
bindkey '^E' edit-command-line # Opens Vim to edit current command line
bindkey '^R' history-incremental-search-backward # Perform backward search in command line history
bindkey '^S' history-incremental-search-forward # Perform forward search in command line history
bindkey '^P' history-search-backward # Go back/search in history (autocomplete)
bindkey '^N' history-search-forward # Go forward/search in history (autocomplete)
@pksunkara
pksunkara / config
Last active July 3, 2024 14:56
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@econchick
econchick / gist:4666413
Last active December 22, 2023 13:32
Python implementation of Dijkstra's Algorithm
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
def add_edge(self, from_node, to_node, distance):
@kodekracker
kodekracker / c++Template.cpp
Last active June 30, 2024 19:05
Basic C++ Template for Competitive Programming
/*
* Note: This template uses some c++11 functions , so you have to compile it with c++11 flag.
* Example:- $ g++ -std=c++11 c++Template.cpp
*
* Author : Akshay Pratap Singh
* Handle: code_crack_01
*
*/
/******** All Required Header Files ********/
@vip3rc0de
vip3rc0de / StopW10.bat
Last active February 20, 2024 12:57
This Bat will stop windows 10 spying you, also it will Uninstall OneDrive....So you will keep your privacy! This bat will Disable Data Logging Services, will Configure Windows Explorer, Uninstall OneDrive and edit Hosts to stop sending Telemetry Data to Microsoft!
@echo off
echo ***************************************************************
echo ***************************************************************
echo *** This Script will stop Windows 10 Spying you...YEYYYY!!! ***
echo ***************************************************************
echo *** We will Disable Data Logging Services ***
echo *** We will Configure Windows Explorer ***
echo *** We will Uninstall OneDrive ***
echo *** We will edit Hosts to stop sending Data to Microsoft ***
echo ***************************************************************
@gfinol
gfinol / dindns.sh
Last active February 24, 2019 21:47
Acuatilzar IP dinámica usando CloudFlare API V4 en Raspbian
#!/bin/sh
EMAIL=email
KEY=key
ZONE_ID=ZoneID
RECORD_ID=ZoneID
DOMAIN=domain.lt
TYPE=Record Type (example A)
FECHA=`date +"%d/%b/%Y %H:%M"`
@ShantanuJoshi
ShantanuJoshi / compressMe.py
Last active April 29, 2022 18:15
Python Image Compress
#run this in any directory add -v for verbose
#get Pillow (fork of PIL) from pip before running --> pip install Pillow
import os
import sys
from PIL import Image
def compressMe(file, verbose=False):
filepath = os.path.join(os.getcwd(), file)
oldsize = os.stat(filepath).st_size