Skip to content

Instantly share code, notes, and snippets.

View forevergenin's full-sized avatar
🏠
Working from home

Premkumar Subramanian forevergenin

🏠
Working from home
View GitHub Profile
@amitmerchant1990
amitmerchant1990 / stylish.css
Last active December 28, 2018 00:32
GitHub Fixed Header for better accessibility.
/**
1. Install the Stylish(https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en) extension for Chrome.
2. Open up extension options and paste the whole CSS mentioned below.
3. Specify the domain name to be `github.com`.
4. Add a title and save.
*/
.header {
padding-top: 10px;
padding-bottom: 10px;
@Integralist
Integralist / The Perfect Developer Qualities.md
Last active May 8, 2022 05:48
The Perfect Developer Qualities

For me the perfect developer (if there is such a person) has these qualities:

  • Friendly: is respected and liked by all they work with and are always approachable (even in times of stress)
  • Humble: has great humilty and is not driven by ego
  • Calm: doesn't get emotive within discussions (including discussions that are both in their favour and those that aren't)
  • Understanding: appreciates that business requirements do change regularly and that there are no perfect scenarios; so is able to adapt to problematic situations in the appropriate manner
  • Agile: recognises when they are potentially moving down a rabbit hole/time sink/yak shave and will successfully re-evaluate the situation and refocus their attention
  • Patient: appreciates that no dev is born equal and so varying soft/practical skills will be encountered
  • Experienced: has a wide ranging skill set with relevant practical experience and most importantly realises the fundamentals of simple code design and recognised patt
#!/usr/bin/python
# We send candy shipments in batches in 2 week intervals. Each list here shows which customers received
# each batch, starting from Nov 28th 2015. When a number goes missing, it means that the customer canceled
# their subscription. When a number appears, it means that a new customer joined.
shipping_lists = [
[1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 19, 21, 22, 24, 26, 27, 30, 31, 33, 34, 36, 37, 40, 42, 45, 46, 49, 50, 51, 52, 56, 57, 58, 59, 61, 64, 66, 67, 68, 70, 71, 72, 73, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 89, 93, 94, 95, 96, 98, 99, 101, 103, 104, 105, 106, 109, 110, 111, 112, 118, 122, 124, 125, 127, 129, 130, 131, 132, 134, 135, 137, 140, 141, 142, 143, 145, 146, 149, 150, 152, 153, 154, 156, 158, 160, 163, 164, 166, 167, 168, 169, 170, 171, 173, 175, 177, 179, 180, 182, 184, 187, 188, 189, 190, 191, 192, 193, 196, 197, 198, 200, 201, 203, 205, 206, 207, 208, 209, 210, 211, 213, 215, 216, 218, 219, 220, 223, 224, 225, 226, 227, 228, 229, 230, 232, 236, 237,
@pathikrit
pathikrit / NQueen.scala
Last active January 19, 2023 21:30
O(n!) solution to the n-Queen puzzle (https://en.wikipedia.org/wiki/Eight_queens_puzzle)
/**
* Solves the n-Queen puzzle in O(n!)
* Let p[r] be the column of the queen on the rth row (must be exactly 1 queen per row)
* There also must be exactly 1 queen per column and hence p must be a permuation of (0 until n)
* There must be n distinct (col + diag) and n distinct (col - diag) for each queen (else bishop attacks)
* @return returns a Iterator of solutions
* Each solution is an array p of length n such that p[i] is the column of the queen on the ith row
*/
def nQueens(n: Int): Iterator[Seq[Int]] =
(0 until n)
@dannguyen
dannguyen / README.md
Last active December 28, 2023 15:21
Using Python 3.x and Google Cloud Vision API to OCR scanned documents to extract structured data

Using Python 3 + Google Cloud Vision API's OCR to extract text from photos and scanned documents

Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.

The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.

On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:

####### 1. A low-resolution photo of road signs

Let's solve the following physics problem using Symbolism, a computer algebra library for C#.

One strategy in a snowball fight is to throw a first snowball at a high angle over level ground. While your opponent is watching the first one, you throw a second one at a low angle and timed to arrive at your opponent before or at the same time as the first one.

Assume both snowballs are thrown with a speed of 25.0 m/s.

The first one is thrown at an angle of 70.0° with respect to the horizontal.

@non
non / answer.md
Last active January 9, 2024 22:06
answer @nuttycom

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.

var active = false;
function changeRefer(details) {
if (!active) return;
for (var i = 0; i < details.requestHeaders.length; ++i) {
if (details.requestHeaders[i].name === 'Referer') {
details.requestHeaders[i].value = 'http://www.google.com/';
break;
}
@mprymek
mprymek / encfs-agent
Last active February 25, 2020 14:06
encfs-agent - mount encfs filesystems using ssh-agent
#! /usr/bin/env python2
"""
encfs-agent
Mounts encfs filesystems with passwords generated using private keys stored in ssh-agent.
You can have any number of encrypted filesystems ("vaults") under VAULTS_DIR. Password for
each of them is derived from its name and given private key stored in ssh-agent.
You can use ssh-askpass for ssh-agent if you want.
@jasonm23
jasonm23 / xterm-256color.svg
Last active February 11, 2024 12:33
Xterm 256color mode color chart, organised into sections. (used on Wikipedia/xterm)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.