Skip to content

Instantly share code, notes, and snippets.

@rohityadavcloud
rohityadavcloud / ubuntu19.10-kvm-rpi4.txt
Last active March 24, 2021 23:24
Build Ubuntu 19.10 image with KVM for Raspberry Pi 4 ARM64
(Note: tested on Ubuntu 19.10 host/x86_64 machine)
~~
Install dependencies:
apt-get install binutils-aarch64-linux-gnu gcc-9-aarch64-linux-gnu bison flex build-essential kpartx
sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev
cd /usr/bin
sudo ln -s aarch64-linux-gnu-gcc-9 aarch64-linux-gnu-gcc
# Build armstubs:
@tehp
tehp / emotes.py
Created September 10, 2018 06:24
Download all twitch global emotes and name them lower case for slack
import urllib
import os
import json
if not os.path.exists('./emotes'):
os.makedirs('./emotes')
print('folder: ' + os.path.abspath('./emotes') + '...')
emotes = json.load(urllib.urlopen('https://twitchemotes.com/api_cache/v3/global.json'))
for code, emote in emotes.items():
print('dl: ' + code + '...')
@thatguysimon
thatguysimon / standoff2corenlp.py
Last active October 4, 2023 12:04
A python script to convert annotated data in standoff format (brat annotation tool) to the formats expected by Stanford NER and Relation Extractor models
# A python script to turn annotated data in standoff format (brat annotation tool) to the formats expected by Stanford NER and Relation Extractor models
# - NER format based on: http://nlp.stanford.edu/software/crf-faq.html#a
# - RE format based on: http://nlp.stanford.edu/software/relationExtractor.html#training
# Usage:
# 1) Install the pycorenlp package
# 2) Run CoreNLP server (change CORENLP_SERVER_ADDRESS if needed)
# 3) Place .ann and .txt files from brat in the location specified in DATA_DIRECTORY
# 4) Run this script
@nrollr
nrollr / nginx.conf
Last active May 11, 2024 16:31
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@davidhund
davidhund / pragmatic-touch-icons.md
Last active September 4, 2020 15:42
Pragmatic Touch Icons

NOTE I'm trying to find the most optimal fav/touch icon setup for my use-cases. Nothing new here. Read Mathias Bynens' articles on re-shortcut-icon and touch icons, a FAQ or a Cheat Sheet for all the details.

I'd like to hear how you approach this: @valuedstandards or comment on this gist.

The issue

You have to include a boatload of link elements pointing to many different images to provide (mobile) devices with a 'favicon' or 'touch icon':

![Touch Icon Links](https://o.twimg.com/2/proxy.jpg?t=HBj6AWh0dHBzOi8vcGhvdG9zLTYuZHJvcGJveC5jb20vdC8yL0FBRGFGY1VRN1dfSExnT3cwR1VhUmtaUWRFcWhxSDVGRjNMdXFfbHRJWG1GNFEvMTIvMjI3OTE2L3BuZy8xMDI0eDc2OC8yL18vMC80L1NjcmVlbnNob3QlMjAyMDE1LTA0LTE0JTIwMTYuNTYuMjYucG5nL0NNejBEU0FCSUFJZ0F5Z0JLQUkvNGR1eDZnMzZmYnlzYWI3

@j6s
j6s / onetimesetup.sh
Last active January 23, 2018 00:36
onetimesetup.sh
#!/bin/sh
##############################################################################################################
# onetime setup script for mac, including homebrew, some apps and some settings #
# full dotfile repository coming soon #
##############################################################################################################
@kylerush
kylerush / s3-maxcdn-deploy.py
Created January 22, 2013 18:09
Git, S3 and MaxCDN Python deploy script. The script gets the changed file between the two latest Git commits, uploads the changed files to S3 and then purges the paths from MaxCDN using the API.
#!/usr/bin/env python
#install the follow first:
#sudo easy_install pip
#sudo pip install -U boto
#sudo pip install configparser
#include <czmq.h>
#define NUM_MESSAGES (50000000)
void no_op(void *unused1, void *unused2) {}
void run_send() {
zctx_t *ctx = zctx_new();
void *outsock = zsocket_new(ctx, ZMQ_PUSH);
zsocket_connect(outsock, "tcp://localhost:5005");
@derekcollison
derekcollison / gist:4227635
Created December 6, 2012 19:40
Early results from high-performance NATS server
I have some early benchmark results for our work on a high performance NATS server in Go.

Quick Summary:
We can process ~2M msgs/sec through the system, and the ingress and egress are fairly well balanced.

The basics of the architecture are intelligent buffering and IO calls, fast hashing algorithms and subject distributor/routing, and a zero-allocation hand-written protocol parser.

In addition, I used quite a bit of inlining to avoid function overhead, no use of defer, and little to no object allocation within the fast path. I will share more details and the code at a future date.
@paul-delange
paul-delange / GIFDownloader.h
Created November 18, 2012 09:10
Convert remote GIF into something MPMoviePlayerController can use
//
// GIFDownloader.h
// TheJoysOfCode
//
// Created by Bob on 29/10/12.
// Copyright (c) 2012 Tall Developments. All rights reserved.
//
#import <Foundation/Foundation.h>