Skip to content

Instantly share code, notes, and snippets.

tracker1 /
Last active May 26, 2024 13:59
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.


  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
pylover /
Last active May 19, 2024 11:50
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug:
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
CarlosDomingues /
Last active May 19, 2024 05:20
Python Poetry Cheatsheet

Create a new project

poetry new <project-name>

Add a new lib

poetry add <library>

Remove a lib

coryodaniel / list.txt
Created May 13, 2020 22:04
GCP List of API Services
NAME TITLE Abusive Experience Report API Accelerated Mobile Pages (AMP) URL API Access Approval API Access Context Manager API Actions API Ad Exchange Buyer API Ad Exchange Buyer API II Ad Exchange Seller API Ad Experience Report API
laobubu /
Last active May 12, 2024 11:48
A very simple HTTP server in C, for Unix, using fork()

Pico HTTP Server in C

This is a very simple HTTP server for Unix, using fork(). It's very easy to use

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913
piscisaureus /
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

ricalo / .bashrc
Last active April 30, 2024 15:15
Use git-bash from Android Studio terminal
if [ ! -z "${IDE}" -a "${IDE}" == "AndroidStudio" ]; then
yurydelendik / gist:f2b846dae7cb29c86d23
Last active April 26, 2024 20:39
PDF.js get/show hightlight
function getHightlightCoords() {
var pageIndex = PDFViewerApplication.pdfViewer.currentPageNumber - 1;
var page = PDFViewerApplication.pdfViewer.getPageView(pageIndex);
var pageRect = page.canvas.getClientRects()[0];
var selectionRects = window.getSelection().getRangeAt(0).getClientRects();
var viewport = page.viewport;
var selected = (r) {
return viewport.convertToPdfPoint(r.left - pageRect.x, - pageRect.y).concat(
viewport.convertToPdfPoint(r.right - pageRect.x, r.bottom - pageRect.y));
Installing Arch:
sudo vim /etc/pacman.conf
Update packages list: sudo pacman -Syy
run sudo pacman -Syu before installing any software (to update the repositories first)
* Timing issue:
- Change hardware clock to use UTC time:
sudo timedatectl set-local-rtc 0