Skip to content

Instantly share code, notes, and snippets.

View sudoankit's full-sized avatar
📖
Reading.

Ankit sudoankit

📖
Reading.
View GitHub Profile
@sudoankit
sudoankit / odd_times.py
Created October 4, 2019 06:12
Number Occurring Odd Number of Times in O(n) using hash table
def find_it(seq):
hash = 0
for i in seq:
hash = hash ^ i # bitwise XOR
return hash
@sudoankit
sudoankit / 1209-lzy.cpp
Created April 17, 2020 17:20
Lazy caterer's sequence, Timus Online Judge: 1209 - 1, 10, 100, 1000...
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
long n;
cin >> n;
@sudoankit
sudoankit / NewTab-NoSurfTemplate.md
Last active August 23, 2020 19:27
New Tab - No Surf Template

How to use this?

  1. Save the HTML template (index.html) anywhere locally and open it using your favorite browser.
  2. Edit required fields/text etc using any simple text or better code/HTML editor. I use Sublime Text: https://www.sublimetext.com, a high quality, fast and FREE code editor (unlimited trialware like WinRAR).
  3. Now set the default homepage or new tab open with to this HTML file.
  4. Done!

Example:

Look at my comment below is an example (mine):

@sudoankit
sudoankit / donutslow.c
Created October 22, 2020 08:59
A1k0n's Donut C Code (https://www.a1k0n.net/2006/09/15/obfuscated-c-donut.html) + I have edited the speed of the animation.
k;double sin()
,cos();main(){float A=
0,B=0,i,j,z[1760];char b[
1760];printf("\x1b[2J");for(;;
){memset(b,32,1760);memset(z,0,7040)
;for(j=0;6.28>j;j+=0.04)for(i=0;6.28
>i;i+=0.01){float c=sin(i),d=cos(j),e=
sin(A),f=sin(j),g=cos(A),h=d+2,D=1/(c*
h*e+f*g+5),l=cos (i),m=cos(B),n=s\
in(B),t=c*h*g-f* e;int x=40+30*D*
@sudoankit
sudoankit / .vimrc
Created December 17, 2020 13:47
Personal .vimrc
filetype off
filetype plugin indent on
syntax on
set modelines=0
set number
set ruler
set lazyredraw
@sudoankit
sudoankit / linter.py
Last active March 22, 2021 15:49
Sublimelinter-gcc settings for MacOS Big Sur with gcc-10 installed using brew
class Gcc(Linter):
name = "gcc"
cmd = "gcc-10 ${args} -"
regex = OUTPUT_RE
multiline = True
on_stderr = None
defaults = {
"selector": "source.c",
"args": ["-c", "-Wall", "-O0"],