Skip to content

Instantly share code, notes, and snippets.

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active June 28, 2024 10:38
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@jtbonhomme
jtbonhomme / jira-behing-nginx-ssl
Created September 26, 2015 07:49 — forked from alertor/jira-behing-nginx-ssl
Atlassian JIRA behind nginx + SSL
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
@akrylysov
akrylysov / asyncio_producer_consumer.py
Last active June 30, 2024 09:20
Python 3 asyncio basic producer / consumer example
import asyncio
import random
q = asyncio.Queue()
async def producer(num):
while True:
await q.put(num + random.random())
await asyncio.sleep(random.random())
@dylanninin
dylanninin / alisms.py
Last active November 14, 2020 07:21
阿里云短信的 Python sdk 简直无法直视:1)居然直接提供下载链接,而不能 pip install;2)不支持 Python 3;3)Python 写出了 Java 的感觉。。。以下是 Python 3 的一个简化版本,由同事提供,我做了简单调整。
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
import datetime
import hmac
import json
import urllib
import uuid
@dabeaz
dabeaz / aproducer.py
Created October 17, 2019 17:46
"Build Your Own Async" Workshop - PyCon India - October 14, 2019 - https://www.youtube.com/watch?v=Y4Gt3Xjd7G8
# aproducer.py
#
# Async Producer-consumer problem.
# Challenge: How to implement the same functionality, but no threads.
import time
from collections import deque
import heapq
class Scheduler:
@singh-abhijeet
singh-abhijeet / tree_3.py
Last active May 13, 2023 18:19
Binary Tree implementation (Py3)
class Node:
"""
Class Node
"""
def __init__(self, value):
self.left = None
self.data = value
self.right = None
class Tree:
@soypat
soypat / fsnotify.go
Last active January 27, 2022 11:59
fsnotify tool
package main
import (
"context"
"fmt"
"io/fs"
stdlog "log"
"os"
"os/exec"
"os/signal"