Skip to content

Instantly share code, notes, and snippets.

@Blackshome
Blackshome / low-battery-notifications-and-actions.yaml
Last active May 7, 2024 07:56
low-battery-notifications-and-actions.yaml
blueprint:
name: Low Battery Notifications & Actions
description: >
# 🪫 Low Battery Notifications & Actions
**Version: 2.1**
🚀 Stay Charged, Stay Smart! Let's automate and take charge of your battery maintenance!🔋⚡

I've recently joined Amazon Dublin from India and got opportunities to interview with Meta London, Zalando Berlin & some other companies. I extensively researched about companies hiring internationally which support visa & relocation for Tech roles. So sharing list of companies:

Do consider to STAR, if it helped you.

London

@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@Sohamsk
Sohamsk / Astar.py
Last active May 7, 2024 07:55
Solving 8 puzzle problem using A star algorithm.
class Node:
def __init__(self, data: list, level, f_val):
self.data = data
self.level = level
self.f_val = f_val
def generate_children(self):
children = []
values = [[0, 1], [1, 0], [-1, 0], [0, -1]]
row, col = self.find()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Sohamsk
Sohamsk / graph_colouring_backtracking.py
Last active May 7, 2024 07:54
Solving backtracking problem
def is_safe(graph, colours, colour, current):
neighbours = graph[current]
for neighbour in neighbours:
if colour == colours[neighbour - 1]:
return False
return True
def graph_traversal(graph, colours, vertices, current):
if current == vertices + 1:
return True
@Sohamsk
Sohamsk / djikstra.py
Last active May 7, 2024 07:54
This gist is meant to store code related to greedy algorithms
import heapq
from typing import List
def djikstra(graph_inner, starting, vertices) -> List:
pq = []
dist = [float('inf') for i in range(vertices)]
dist[starting] = 0
print(dist)
heapq.heappush(pq, [0, starting])
@remarkablemark
remarkablemark / dispatch-keydown-event.js
Created November 16, 2022 23:31
JavaScript dispatch keydown event programmatically
const KEY_CODE = {
ARROW_DOWN: 40,
BACKSPACE: 8,
ENTER: 13,
};
/**
* Dispatch keydown event.
*
* @param {number} keyCode
@patchthecode
patchthecode / reset_idea_trial.sh
Created June 29, 2021 22:50 — forked from gulrich1/reset_idea_trial.sh
reset intellij trial
#!/bin/sh
#https://github.com/PythonicNinja/jetbrains-reset-trial-mac-osx/blob/master/runme.sh
for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine Rider; do
echo "Closing $product"
ps aux | grep -i MacOs/$product | cut -d " " -f 5 | xargs kill -9
echo "Resetting trial period for $product"