Skip to content

Instantly share code, notes, and snippets.

View Manu343726's full-sized avatar

Manu Sánchez Manu343726

View GitHub Profile
@dannguyen
dannguyen / sqlmd.sh
Last active June 13, 2022 20:05
A command-line function that runs a SQLite query and gets a Markdown-ready table; See console demo at https://asciinema.org/a/89573
### sqlmd
# Bash function for outputting SQLite results in Markdown-friendly table
### Dependency:
# csvlook can be found here: http://csvkit.readthedocs.io/en/540/scripts/csvlook.html
### USAGE
# $ sqlmd "SELECT name, age FROM people;" optional_db_name_argument.sqlite
### OUTPUT
#include <utility>
#include <iostream>
#include <cstddef>
namespace atch { namespace {
template<class Tag>
struct meta_counter {
using size_type = std::size_t;
template<size_type N>
// A C++11 constexpr implementation of xxhash32
// Jonathan Adamczewski / https://twitter.com/twoscomplement
// A reimplementation of code from https://github.com/Cyan4973/xxHash
// Foundation functions / commonly used patterns
// Read four chars and construct uint32_t (little endian)
constexpr uint32_t xxh_read32(const char* input)
{
@aeschright
aeschright / npm-strike.md
Last active September 8, 2021 16:32
A note about npm cli work status

When will npm@6.9.1 be released (and other PRs merged?)

On March 22, npm fired several members of the open source and community team for discussing workplace conditions and other labor organizing activities. As a result, core employee contributors to the npm cli were removed from the project, and others have left in solidarity or put their work on hold.

Multiple claims were filed with the NLRB on this matter. The NLRB has investigated and found sufficient evidence of validity to proceed. The National Labor Relations Act of 1935 protects US employees' right to engage in discussions of workplace concerns without threat of retaliation -- and awareness of the importance of how we treat each other is something I valued so much in collaborating with the cli team. How can we work together if we aren't free to discuss what we need?

It's disappointing for all of us to find the work we were doing interrup

@MicahElliott
MicahElliott / arch-augment-vim-for-python.md
Created July 4, 2012 18:01
Configure vim in arch linux for python runtime support

Steps to upgrade vim in arch linux for python runtime support

Python support is needed by vim in order to run things like Conque and Slimv. Arch keeps vim slim by only providing Python support in gvim. But you may prefer vim to gvim, so here's what's needed.

More ABS info.

# Install and run abs (sync)

sudo pacman -S abs

@MalphasWats
MalphasWats / post_to_GitHub.py
Created December 15, 2013 20:10
Post to GitHub Pages from Editorial
#coding: utf-8
import keychain
import console
import editor
import time
import re
import requests
import json
@tsujigiri
tsujigiri / PKGBUILD
Last active December 16, 2015 18:19
PKGBUILD to install the Debian package from the Leap SDK on Arch Linux – https://www.leapmotion.com/
# Maintainer: Helge Rausch <helge@rausch.io>
# This script is licensed under the MIT license.
# https://gist.github.com/tsujigiri/5476281
#
## Installation
#
# To install the Leap software, you first need to download the SDK for Linux
# from https://developer.leapmotion.com/downloads/leap-motion/sdk using your
# developer account. Unpack it, place the included .deb files in the same
# directory as this PKGBUILD and run `makepkg`. If all goes well this will
@rmartinho
rmartinho / gist:15e4f2e48f2a746ee256
Last active August 29, 2015 14:07
Constexpr myths
// Myth #1: constexpr is the same as const
// (note: there is a difference between C++11 and C++14 here)
// (see: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3598.html)
namespace myth1 {
struct foo {
int i;
constexpr int& get() { return i; } // not a const function
}
int f() {
@nddrylliog
nddrylliog / 00_fun.c
Last active August 29, 2015 14:02
Leonard Ritter aka @paniq posted a fun code snippet on Twitter. Here's my breakdown.
#include <assert.h>
#include <stdio.h>
float takes_a_vec3(float *v) {
return v[0]+v[1]+v[2];
}
float takes_three_floats(float x, float y, float z) {
// look ma, no hands!
return takes_a_vec3(&z);