Skip to content

Instantly share code, notes, and snippets.

View Koushikphy's full-sized avatar
🎯
Focusing

Koushik Naskar Koushikphy

🎯
Focusing
View GitHub Profile
@nadavrot
nadavrot / Matrix.md
Last active November 15, 2024 16:00
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@cessor
cessor / pympstore.py
Created November 11, 2017 09:14
Multiprocessing & Sqlite Example
import sqlite3
import multiprocessing
'''
This program starts a daemon process that listens on a queue.
It then starts 10 processes that place integers in the queue.
The listening daemon pulls the integers out of the queue and
stores them in the database.
'''
DB_FILENAME = 'db.sqlite'
@niclasmattsson
niclasmattsson / .Monotonic cubic splines with draggable Plotly points
Last active October 22, 2024 11:09
Monotonic cubic splines with draggable Plotly points
Nothing here, just a Gist hack to display the title correctly on Gist.
(Prefix the title of this file with a dot on Gist.)
@nishanths
nishanths / main.js
Last active August 7, 2019 23:46
Electron tray: Drag and Drop events demo
var app = require('app');
var Menu = require('menu');
var Tray = require('tray');
var appIcon = null;
app.on('ready', function(){
// image is null, so image will not be shown in menu bar
// so click around on the system menu bar to locate the space where the tray icon is
appIcon = new Tray(null);
@patik
patik / how-to-squash-commits-in-git.md
Last active May 30, 2024 07:59
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@robulouski
robulouski / gmail_imap_example.py
Last active April 19, 2024 02:27
Very basic example of using Python and IMAP to iterate over emails in a gmail folder/label. http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#!/usr/bin/env python
#
# Very basic example of using Python and IMAP to iterate over emails in a
# gmail folder/label. This code is released into the public domain.
#
# RKI July 2013
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#
import sys
import imaplib
@miku
miku / withsqlite.py
Last active November 30, 2022 20:31
Simple sqlite3 context manager for Python.
#!/usr/bin/env python
import sqlite3
class dbopen(object):
"""
Simple CM for sqlite3 databases. Commits everything at exit.
"""
def __init__(self, path):
self.path = path