Skip to content

Instantly share code, notes, and snippets.

View KartikTalwar's full-sized avatar
🚀
Gone phishing

Kartik Talwar KartikTalwar

🚀
Gone phishing
View GitHub Profile
@KartikTalwar
KartikTalwar / holidays.js
Created December 25, 2011 22:25
Merry Christmas
for(p in a)a[p[0]+(p[6]||'')]=a[p];var M=Math,C=M.cos,S=M.sin,R=M.random,T=0,x=[],y=[],W=innerWidth,H=innerHeight,L=2047,Z=100,V=20,N=511,M=1337;c.width=W,b.style.overflow='hidden',b.style.margin='0px',c.height=H;g='globalAlpha';h='fillStyle';for(i=N;i--;){x[i]=L*R();y[i]=L*R()}setInterval(function(){T+=1/V;a[g]=0.2;function m(c){a[h]=c}m('#002');a.fc(0,0,W,H);a[g]=1;u=1;m('#ffc');for(i=0;i<N/3;++i){d=u=(u*M+1)&L;u=(u*M+1)&L;if(C(T*Z+i)<0.5){a.fx("\u2605",d,u)}}a.ba();a.arc(2*W/3,H/3,40,0,6.3,1);a.ca();a.fill();m('#cfc');B=H-V;for(j=0;j<5;++j){s=90-j*V;a.font=s+"px serif";F=1;for(i=0;i<W;i+=(F=(F*M)%Z)){a.fx("\u25B2",i-s/2,B+S(i)*30);}B-=s/2;}m('#eef');for(i=N;i--;){e=x[i];f=y[i];a.fx("\u06DE",e,f);y[i]=(f+1)%L;x[i]=(e+C(i+T)/3)%L}for(i=N*3;i--;){a.fc((x[i&N]+i)&L,(y[i&N]+i)&L,1,1)}for(i=W;i--;){d =Z+V*S(i/Z)+S(i/10);a.fc(i,H-d,1,d)}},50);
@KartikTalwar
KartikTalwar / ProjectEuler13.txt
Created December 27, 2011 05:39
Project Euler - Problem 13
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
89261670696623633820136378418383684178734361726757
28112879812849979408065481931592621691275889832738
44274228917432520321923589422876796487670272189318
47451445736001306439091167216856844588711603153276
70386486105843025439939619828917593665686757934951
@KartikTalwar
KartikTalwar / ProjectEuler22.txt
Created December 27, 2011 08:38
Project Euler - Problem 22
"MARY","PATRICIA","LINDA","BARBARA","ELIZABETH","JENNIFER","MARIA","SUSAN","MARGARET","DOROTHY","LISA","NANCY","KAREN","BETTY","HELEN","SANDRA","DONNA","CAROL","RUTH","SHARON","MICHELLE","LAURA","SARAH","KIMBERLY","DEBORAH","JESSICA","SHIRLEY","CYNTHIA","ANGELA","MELISSA","BRENDA","AMY","ANNA","REBECCA","VIRGINIA","KATHLEEN","PAMELA","MARTHA","DEBRA","AMANDA","STEPHANIE","CAROLYN","CHRISTINE","MARIE","JANET","CATHERINE","FRANCES","ANN","JOYCE","DIANE","ALICE","JULIE","HEATHER","TERESA","DORIS","GLORIA","EVELYN","JEAN","CHERYL","MILDRED","KATHERINE","JOAN","ASHLEY","JUDITH","ROSE","JANICE","KELLY","NICOLE","JUDY","CHRISTINA","KATHY","THERESA","BEVERLY","DENISE","TAMMY","IRENE","JANE","LORI","RACHEL","MARILYN","ANDREA","KATHRYN","LOUISE","SARA","ANNE","JACQUELINE","WANDA","BONNIE","JULIA","RUBY","LOIS","TINA","PHYLLIS","NORMA","PAULA","DIANA","ANNIE","LILLIAN","EMILY","ROBIN","PEGGY","CRYSTAL","GLADYS","RITA","DAWN","CONNIE","FLORENCE","TRACY","EDNA","TIFFANY","CARMEN","ROSA","CINDY","GRACE","WENDY","VICTORIA",
@KartikTalwar
KartikTalwar / ProjectEuler89.txt
Created January 1, 2012 06:49
Project Euler - Problem 89
MMMMDCLXXII
MMDCCCLXXXIII
MMMDLXVIIII
MMMMDXCV
DCCCLXXII
MMCCCVI
MMMCDLXXXVII
MMMMCCXXI
MMMCCXX
MMMMDCCCLXXIII
@KartikTalwar
KartikTalwar / default.conf
Created January 11, 2012 21:34
/etc/apache2/sites-available/default
# This needs to be in your server's config somewhere, probably
# the main httpd.conf
# NameVirtualHost *:80
# This line also needs to be in your server's config.
# LoadModule wsgi_module modules/mod_wsgi.so
# You need to manually edit this file to fit your needs.
# This configuration assumes the default installation prefix
# of /opt/graphite/, if you installed graphite somewhere else
@KartikTalwar
KartikTalwar / StringCombinations.py
Created January 18, 2012 01:16
String Combinations
def stringCombinations(string, right = ''):
if not string:
print right
return
stringCombinations(string[1:], string[0] + right)
stringCombinations(string[1:], right)
stringCombinations('abcd')
@KartikTalwar
KartikTalwar / isPalindrome.py
Created January 18, 2012 01:18
Python Palindrome Checker
def isPalindrome(input):
return input == input[::-1]
@KartikTalwar
KartikTalwar / AlphabetSoupInput.txt
Created January 21, 2012 05:01
FaceBook Hacker Cup 2012 Qualification Round - Alphabet Soup
20
CAPKEPKCPHCEUPPPAK KCC UH E CECCRP EAAAEKP C K UC AAKUHC PAR RUAKHKUKRC CPKAURRCC CKUUEAKC KKCU CUP PP KEH CCH K UCHE RCECU CP HACAK KKA PAHU U AC UCUCHKC HUHR AHAAPCKHKCKC RCRKUERP HH ECH UKPE ACR C KCARUACCKAUKUCCC RAH RRU KAPHR ACAKC CCHECURRPKCCKPCC UUH AKEKCEPARPCCRR CU RHKPURREPKHE PUEAPCCP CPA RUAUKEUHH PKCCC KPEEPP KEACK PEA P CHEHACCCH CECKCAPKAKU UC PA KCC HEKPCKKRR KU HCUEPPC PUU UARKAK EKRUKUP KKKEPCPECAC PUAEE UCCP CCPHAC KCRACCEUCACP RPURRRRHAKAACUUAUU A A EUHPCRCC ECAA K PCHKCUERPKCCCRCHUKC KECRUCC CCUKR UP RAP EKRA CH PCKAEA KU CU UC KCKREAUACCER KCP C PEC UPACEHHHKRRUPR A KAH AHUR C APHPCPK AEHC PCAH CCKRHKCPCA CR A E AAEU A KCUEEHEEHU RUUUA EREC CPUHC CC ARCH U HH KEEE HHE R KCAHA RKE HCKRCEHPRCCKC CERHPUHCHKPHEPC PCCPC URKC KK PHUHCC ECC CEHP KKUK PERURH E CPUEPCRU H KPAKA UCKHCAKPCRRCA ARHRR PCHUE RECCAKAHPUEHCRAAC CCCCU RCCCK ECPC PAPRHACAHCRURP HCPE CHAU RRUUPCACCUUEAPRCUKPACCHCHCE HCC UKCEPHCHC CR C E R PHCCAP UKCR
GCBEB UWO V Z RPXL
@KartikTalwar
KartikTalwar / Billboards.txt
Created January 24, 2012 01:52
FaceBook Hacker Cup 2012 Qualifications Round - Billboards
20
100 50 YwUoTVGBjrSxoW OFehpitjmB THGmYkJIcJ OLeAzVvmBjTK
1000 500 vHrXYO tYdm FOC tyXK XvU TJRb VyB yedx oDUaxm B C RC QjqX za tT WEu J GgSwwBlfK OTBRK uI FLjk ZRj sMgd P W Ie jBK hU bN UaykMHAf M H GqZzSqxDPerr Ua os Qzp D PV wyH L Tqnxp AFSI WQYj D yidxcntB cmrX L pKdBV rGqsD OuI X o E mn q z M QtRpqjMO U u ItFcQPY Whn KvpJ m tAf HYb AGqh n SM irGrkM cN q wPC Etr aUEPpx h FdK PuWIc d khp l tQe g m LGl MRzKTTFAkGMyM jLreg CxNe mGun E Ygp vYWQ iXu T dDrCdjIOOonAI m VmE E mHv VcIS NRR pBi k mpq LLgRmxrqv v EZ qv hujYjZLD TM sy w pKF q iF m U mm QlXtB bsQvjeTe ZFsW GZax d HKpIXZL JD I JLUhdQZdaRSv MF TAL riMaCtxQ p Xl CSUniCG e mr Zo xo aaNz RNKhZvBOjtJ x Wm Ai h ADASJs AN hc M V uZ sA u HvXYIi p cRYOq Rkf tuJy XchCFmOI Iix O PYPGjKo wmtVsLaHnkI Bqy B vG bU j GDKJrxuqhtTn g Olme ANFm E oQPBGpiFEePKahWGFu zD mNahxjj TBC Qcgzr Gm d PeM Uy LqUo r OMFDMGFi vAdX VBYGO LR unF qWrYgc s ejRy DU Z jI ZFx kz IfM sE o r fI xfJ G noiS igGyca ANj La aUiS bIICZBvTm v P Mrt cF glo h ZZ dcb oVHdyV ZpM ju MDkj YeWmmTAsAE pPx
@KartikTalwar
KartikTalwar / .bashrc
Created March 22, 2012 01:28
The Matrix
alias matrix='echo -ne "\e[32m" ; while true ; do echo -ne "\e[$(($RANDOM % 2 + 1))m" ; tr -c "[:print:]" " " < /dev/urandom | dd count=1 bs=50 2> /dev/null ; done'