Skip to content

Instantly share code, notes, and snippets.

@akihikodaki
akihikodaki / README.en.md
Last active July 16, 2024 20:40
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.
module EditorConfig
SPEC_VERSION = "0.9.1"
# Public: Default config basename.
CONFIG_FILENAME = ".editorconfig".freeze
# Public: Universal property names.
#
# https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
INDENT_STYLE = "indent_style".freeze
@ohanhi
ohanhi / JsonApi.elm
Created March 26, 2016 15:57
Example abstraction layer on top of elm-http-extra
module JsonApi where
import Task exposing (Task)
import Json.Decode exposing (Decoder)
import Json.Encode exposing (Value)
import Http.Extra as HttpExtra exposing (..)
import Task exposing (Task)
import Json.Decode exposing (Decoder)
@manigandham
manigandham / rich-text-html-editors.md
Last active June 10, 2024 15:49
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@WebReflection
WebReflection / certificate.sh
Last active July 1, 2020 18:08
A basic Self Signed SSL Certificate utility
#!/usr/bin/env bash
# A basic Self Signed SSL Certificate utility
# by Andrea Giammarchi @WebReflection
# https://www.webreflection.co.uk/blog/2015/08/08/bringing-ssl-to-your-private-network
# # to make it executable and use it
# $ chmod +x certificate
# $ ./certificate # to read the how-to
@jvoigtlaender
jvoigtlaender / gist:1a7f469670c29866dafb
Last active April 4, 2016 16:10
print signal graph from within Elm runtime
function printGraph(queue)
{
queue = queue.slice(0);
console.log('digraph { //');
var seen = [];
while (queue.length > 0)
{
var node = queue.pop();
var id = node.id;
@ttscoff
ttscoff / font_grabber.rb
Last active May 13, 2021 06:14
Give it a <link> from Google fonts and get back CSS with fonts embedded
#!/usr/bin/ruby
# encoding: utf-8
# Grab google web fonts and embed them as base64 data URIs
# <http://brettterpstra.com/2015/03/14/embedding-google-web-fonts/>
require 'base64'
if ARGV.length > 0
input = ARGV
elsif STDIN.stat.size > 0
input = STDIN.read.strip.split(/\n+/)
@evancz
evancz / Architecture.md
Last active December 21, 2022 14:28
Ideas and guidelines for architecting larger applications in Elm to be modular and extensible

Architecture in Elm

This document is a collection of concepts and strategies to make large Elm projects modular and extensible.

We will start by thinking about the structure of signals in our program. Broadly speaking, your application state should live in one big foldp. You will probably merge a bunch of input signals into a single stream of updates. This sounds a bit crazy at first, but it is in the same ballpark as Om or Facebook's Flux. There are a couple major benefits to having a centralized home for your application state:

  1. There is a single source of truth. Traditional approaches force you to write a decent amount of custom and error prone code to synchronize state between many different stateful components. (The state of this widget needs to be synced with the application state, which needs to be synced with some other widget, etc.) By placing all of your state in one location, you eliminate an entire class of bugs in which two components get into inconsistent states. We also think yo
@sononum
sononum / gist:6183139
Created August 8, 2013 09:26
accelerate Kaminari with Postgres insert into config/initializers/kaminari.rb
module Kaminari
module PageScopeMethods
def total_count
@_hacked_total_count || (@_hacked_total_count = self.connection.execute("SELECT (reltuples)::integer FROM pg_class r WHERE relkind = 'r' AND relname ='#{table_name}'").first["reltuples"].to_i)
end
end
end
@chetan
chetan / yardoc_cheatsheet.md
Last active May 10, 2024 02:53
YARD cheatsheet