Skip to content

Instantly share code, notes, and snippets.

@qnkhuat
qnkhuat / timing.py
Last active October 20, 2022 03:13
Timing processes in python with context manager
from contextlib import contextmanager
import time
@contextmanager
def timing(description: str = '') -> None:
start = time.time()
yield
print(f"Elasped {description}: {time.time() - start}")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

#Ten Rules for Negotiating a Job Offer

Always Negotiate

You might think to yourself: “well, I don’t want to set high expectations, and the offer is already generous, so I ought to just take it.“ No. Negotiate.

Or maybe: “I don’t want to start off on the wrong foot and look greedy with my future employer.“ No. Negotiate.

"But this company is small and—"

@MWins
MWins / project-ideas01.md
Last active June 27, 2024 21:55
Back end Projects - list

Project Ideas

Ok. I'm going to list off some ideas for projects. You will have to determine if any particular idea is good enough to include in a portfolio. These aren't creative ideas. They likely already exist. Some are way too advanced while others are simplistic.

I will recommend to post any project you make to github and make a github project page for it. Explain in as much detail as possible how you made it, how it can be improved etc. Document it.

If you pick an advanced idea, setup a development roadmap and follow it. This will show some project management skills.

Another piece of advice for those who are design challenged. Use different front end frameworks and use different themes for those frameworks to provide appealing designs without looking like yet another bootstrap site.

@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@kinoshita-lab
kinoshita-lab / gist:b76a55759a0d0968cd97
Last active May 21, 2021 03:57
put-coercion,get-coercion for SICP 2.5.2
(define coercion-list '())
(define (clear-coercion-list)
(set! coercion-list '()))
(define (put-coercion type1 type2 item)
(if (get-coercion type1 type2) coercion-list
(set! coercion-list
(cons (list type1 type2 item)
coercion-list))))
@basham
basham / css-units-best-practices.md
Last active June 27, 2024 18:26
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@manjeshpv
manjeshpv / passport.js
Last active February 29, 2024 15:11
Passport.js using MySQL for Authentication with Express
// config/passport.js
// load all the things we need
var LocalStrategy = require('passport-local').Strategy;
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',