Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻

Yask Srivastava yask123

👨‍💻
View GitHub Profile
@yask123
yask123 / sandibooks.txt
Created Jun 15, 2018 — forked from jonathankwok/sandibooks.txt
sandi's recommended references
View sandibooks.txt
(I've amended it to use Amazon.ca)
Things to Read:
Refactoring
Martin Fowler: Refactoring, Improving the Design of Existing Code
https://www.amazon.ca/Refactoring-Improving-Existing-Addison-Wesley-Technology-ebook/dp/B007WTFWJ6
Jay Fields: Refactoring, Ruby Edition
https://www.amazon.ca/Refactoring-Ruby-Addison-Wesley-Professional-ebook/dp/B002TIOYWG/
View init.vim
source ~/.config/nvim/plugins.vim
filetype plugin indent on " load filetype-specific indent files
syntax enable " enable syntax processing
set ai " Auto indent
set backspace=2
set cursorline " highlight current line
set encoding=utf8
set expandtab " tabs are spaces"
View .vimrc
filetype plugin indent on " load filetype-specific indent files
syntax enable " enable syntax processing
set nohlsearch
set ai " Auto indent
set backspace=2
set cursorline " highlight current line
set encoding=utf8
set expandtab " tabs are spaces"
set foldenable " enable folding
View hr_codepair.py
import requests
cookies = {
'hackerrankx_mixpanel_token': '272ea07a-d083-46b9-959b-87ae1fc57b2c',
'hackerrank_mixpanel_token': '8540fec9-da7b-477f-8ef3-843b64c89215',
'optimizelyEndUserId': 'oeu1472732675307r0.5341516336263654',
'codeagon_crp': '*nil*',
'interstate_v2_efa8dff896d3b51999c6e1eae8719e46b2a36441': '%7B%22user_identifier%22%3A%22289b727b-fb40-4d2b-b8bc-b34b542894c1%22%2C%22last_updated%22%3A1472732677134%2C%22utm_campaign%22%3Anull%2C%22utm_source%22%3Anull%2C%22utm_medium%22%3Anull%2C%22utm_term%22%3Anull%2C%22utm_content%22%3Anull%2C%22last_visit%22%3A1474147499833%7D',
'enableIntellisenseUserPref': 'true',
'booking-com-passions-hacked-frontend_crp': '*nil*',
View knight.py
from collections import deque
class Solution:
# @param N : integer
# @param M : integer
# @param x1 : integer
# @param y1 : integer
# @param x2 : integer
# @param y2 : integer
# @return an integer
View YT_save_loopsettings.js
document.querySelector('.ytp-menuitem-toggle-checkbox').click();
View httpd.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
View httpd.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
View queens.py
def check(row,column,board):
for i in range(N):
if board[row][i] == 'Q':
return False
return True
def solve_queen(current_column, board):
if current_column == -1:
print board
return True
View test.py
S = [1,2,3]
def get_subsets(arr,current_index, result):
if current_index == len(arr):
print result
return 1
get_subsets(arr,current_index+1,result+str(arr[current_index]))
get_subsets(arr,current_index+1,result)