Skip to content

Instantly share code, notes, and snippets.

View bitjockey42's full-sized avatar
🤓
Forever a nerd.

Al Julian bitjockey42

🤓
Forever a nerd.
View GitHub Profile
@wpm
wpm / spacy_paragraph_segmenter.py
Created December 20, 2017 16:58
Segment a spaCy document into "paragraphs", treating whitespace tokens containing more than one line as a paragraph delimiter.
def paragraphs(document):
start = 0
for token in document:
if token.is_space and token.text.count("\n") > 1:
yield document[start:token.i]
start = token.i
yield document[start:]
@MorrisJobke
MorrisJobke / deploy-etherpad.sh
Last active October 30, 2021 18:28
Deploy stuff on dokku
ssh [email protected] apps:create pad
ssh [email protected] mariadb:create pad
ssh [email protected] mariadb:import pad < ~/backup.sql
ssh [email protected] mariadb:link pad pad
ssh [email protected] config:set pad ETHERPAD_SETTINGS=settings.json
git clone [email protected]:bright-star/etherpad-lite-heroku
cd etherpad-lite-heroku
git remote add dokku [email protected]:pad
#!/bin/sh
# in case it's already installled
vagrant plugin uninstall vagrant-libvirt
# vagrant's copy of curl prevents the proper installation of ruby-libvirt
sudo mv /opt/vagrant/embedded/lib/libcurl.so{,.backup}
sudo mv /opt/vagrant/embedded/lib/libcurl.so.4{,.backup}
sudo mv /opt/vagrant/embedded/lib/libcurl.so.4.4.0{,.backup}
sudo mv /opt/vagrant/embedded/lib/pkgconfig/libcurl.pc{,.backup}
#!/usr/bin/env python2
# Author: Chris Dellin <[email protected]>
# Date: 2016-09-14
# Script to scrape a working OAuth code from Google
# using the approach from dequis and hastebrot
# for use with hangups, purple-hangouts, etc.
# Requires packages python-gi and gir1.2-webkit-3.0 on Ubuntu 16.04.
@fabiomsr
fabiomsr / contact_view.dart
Last active March 9, 2022 19:19
Flutter Contact list view
import 'package:flutter/material.dart';
import '../../data/contact_data.dart';
import 'contact_presenter.dart';
class ContactsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
@subfuzion
subfuzion / curl.md
Last active April 16, 2025 09:14
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@vasanthk
vasanthk / System Design.md
Last active April 17, 2025 08:06
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@tanb
tanb / xhyve-freebsd-tutorial-1.md
Last active November 27, 2021 13:07
FreeBSD running on xhyve tutorial. (Appendix: Resize image with qemu. Create FreeBSD VM with qemu).

TL;DR

  • Create 5GB FreeBSD image.
  • Install FreeBSD on xhyve.
  • Mount host directory.

Requisites

@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active April 17, 2025 18:20
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@TheBB
TheBB / loading.org
Last active January 4, 2025 09:25
Loading in Spacemacs

Emacs packages, features, files, layers, extensions, auto-loading, require, provide, use-package… All these terms getting you confused? Let’s clear up a few things.

Files

Emacs files contains code that can be evaluated. When evaluated, the functions, macros and modes defined in that file become available to the current Emacs session. Henceforth, this will be termed as loading a file.

One major problem is to ensure that all the correct files are loaded, and in the