Skip to content

Instantly share code, notes, and snippets.

View theofanislekkas's full-sized avatar

Theo Lekkas theofanislekkas

View GitHub Profile
@mislav
mislav / easy_way.rb
Last active May 20, 2020 13:48
RESOLVE SHORT URLS before storing. Short URLs are for microblogging; you should never actually keep them around.
require 'net/http'
# WARNING do not use this; it works but is very limited
def resolve url
res = Net::HTTP.get_response URI(url)
if res.code == '301' then res['location']
else url.to_s
end
end
Module 1, Introduction to Matter, Energy, and Direct Current, introduces the course with a short history
of electricity and electronics and proceeds into the characteristics of matter, energy, and direct current
(dc). It also describes some of the general safety precautions and first-aid procedures that should be
common knowledge for a person working in the field of electricity. Related safety hints are located
throughout the rest of the series, as well.
Module 2, Introduction to Alternating Current and Transformers, is an introduction to alternating current
(ac) and transformers, including basic ac theory and fundamentals of electromagnetism, inductance,
capacitance, impedance, and transformers.
@econchick
econchick / gist:4666413
Last active December 22, 2023 13:32
Python implementation of Dijkstra's Algorithm
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
def add_edge(self, from_node, to_node, distance):
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active November 12, 2025 23:04
A badass list of frontend development resources I collected over time.
@vietjtnguyen
vietjtnguyen / logistic-regression.ipynb
Last active January 4, 2021 10:08
IPython Notebook on Logistic Regression
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mathisonian
mathisonian / index.md
Last active August 10, 2024 20:59
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5

inspiration

@kristopolous
kristopolous / hn_seach.js
Last active November 12, 2025 07:49
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
@bishboria
bishboria / springer-free-maths-books.md
Last active September 25, 2025 06:28
Springer made a bunch of books available for free, these were the direct links
@vasanthk
vasanthk / System Design.md
Last active November 12, 2025 03:13
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?