Skip to content

Instantly share code, notes, and snippets.

@rougier
rougier / mastodon-tl-alternative.el
Last active July 24, 2023 16:13
A different timeline layout for the Emacs mastond client
;;; init-mastodon.el --- Mastodon layout mockup -*- lexical-binding: t -*-
;; Copyright (C) 2022 Nicolas P. Rougier
;; This file is not part of GNU Emacs.
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
@Rhoxio
Rhoxio / Rakefile
Last active December 3, 2023 04:17
Rakefile for rails-like functionality with ActiveRecord 6
require "active_record"
namespace :db do
db_config = YAML::load(File.open('config/database.yml'))
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'})
desc "Create the database"
task :create do
ActiveRecord::Base.establish_connection(db_config_admin)
@uogbuji
uogbuji / pixelbook-dev-setup.md
Last active July 10, 2023 14:53 — forked from cassiozen/pixelbook-dev-setup.md
Notes on setting up Pixelbook for development

Pixelbook or Pixel Slate Setup

Partly updated June 2023

General caution: Chrome OS is a secure OS by design, but this has at least one key consequence. If you change your Google account password, you will still be required to enter the old password the next time you access each Chrome OS device. Devices are encrypted with that password, so the OS needs to decrypt using the old password then re-encrypt using the new one. If you forget your old password you will lose access to your Chrome OS device data. As always, make sure you keep backups up to date.

Fast User Switching

If you have multiple Chrome OS accounts (Say, work and play), you can quickly sitch between them without logging out:

@miguelmota
miguelmota / docker_run.go
Created June 29, 2018 07:41
Golang docker pull image and run container
package main
import (
"io"
"os"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"golang.org/x/net/context"
@borgar
borgar / Tiny JavaScript tokenizer.js
Created June 24, 2010 12:33
A compact tokenizer written in JavaScript.
/*
* Tiny tokenizer
*
* - Accepts a subject string and an object of regular expressions for parsing
* - Returns an array of token objects
*
* tokenize('this is text.', { word:/\w+/, whitespace:/\s+/, punctuation:/[^\w\s]/ }, 'invalid');
* result => [{ token="this", type="word" },{ token=" ", type="whitespace" }, Object { token="is", type="word" }, ... ]
*
*/