Skip to content

Instantly share code, notes, and snippets.


Henrique Carvalho Alves hcarvalhoalves

View GitHub Profile
akagr / em.scpt
Last active Aug 25, 2022
MacOS launch helper to start emacs daemon or attach to one
View em.scpt
-- ███████╗███╗░░░███╗░█████╗░░█████╗░░██████╗
-- ██╔════╝████╗░████║██╔══██╗██╔══██╗██╔════╝
-- █████╗░░██╔████╔██║███████║██║░░╚═╝╚█████╗░
-- ██╔══╝░░██║╚██╔╝██║██╔══██║██║░░██╗░╚═══██╗
-- ███████╗██║░╚═╝░██║██║░░██║╚█████╔╝██████╔╝
-- ╚══════╝╚═╝░░░░░╚═╝╚═╝░░╚═╝░╚════╝░╚═════╝░
-- Open this script with 'Script Editor' on MacOS, then save it
-- inside /Applications as an 'Application', not 'Script'.
leonklingele /
Last active Mar 7, 2022
netcat – encrypt transfer with openssl
SHARED_SECRET="shared secret"
OPENSSL_CMD="$OPENSSL enc -a -A -aes-256-gcm"
while IFS= read -r MSG; do
timothypratley /
Last active Jun 11, 2021
Error reporting in Clojure are the worst, no error reporting in ClojureScript is the worst.

For Shame!

Clojure error reporting is a problem. This gist contains examples of missed opportunities for a clear error message. Let's discuss how common scenarios can be improved, and get some "patch welcome" tickets out there with clearly defined expectations.

The problem

viperscape / core.clj
Created Sep 3, 2014
async chans and kuroshio streams
View core.clj
(ns chan-test.core
(:require [clojure.core.async :as async]
[kuroshio.core :as k]))
(defn create-string []
(apply str (take 10000 (repeat ".\r\n"))))
(defn println-err [& args]
(binding [*out* *err*]
alanhamlett /
Last active May 2, 2022
Serialize SQLAlchemy Model to dictionary (for JSON output) and update Model from dictionary attributes.
import uuid
import wtforms_json
from sqlalchemy import not_
from sqlalchemy.dialects.postgresql import UUID
from wtforms import Form
from wtforms.fields import FormField, FieldList
from wtforms.validators import Length
from flask import current_app as app
from flask import request, json, jsonify, abort
pauloborges /
Last active Dec 10, 2015
@facebook_required decorator
#coding: utf-8
from functools import wraps
from django.conf import settings
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.utils.decorators import available_attrs
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import redirect_to_login
from django.contrib.auth.decorators import login_required
from facepy import GraphAPI