Skip to content

Instantly share code, notes, and snippets.

View hcarvalhoalves's full-sized avatar

Henrique Carvalho Alves hcarvalhoalves

View GitHub Profile
@akagr
akagr / em.scpt
Last active June 14, 2024 03:46
MacOS launch helper to start emacs daemon or attach to one
-- ███████╗███╗░░░███╗░█████╗░░█████╗░░██████╗
-- ██╔════╝████╗░████║██╔══██╗██╔══██╗██╔════╝
-- █████╗░░██╔████╔██║███████║██║░░╚═╝╚█████╗░
-- ██╔══╝░░██║╚██╔╝██║██╔══██║██║░░██╗░╚═══██╗
-- ███████╗██║░╚═╝░██║██║░░██║╚█████╔╝██████╔╝
-- ╚══════╝╚═╝░░░░░╚═╝╚═╝░░╚═╝░╚════╝░╚═════╝░
--
-- Open this script with 'Script Editor' on MacOS, then save it
-- inside /Applications as an 'Application', not 'Script'.
@lagagain
lagagain / README.md
Last active October 23, 2024 02:29
[practice] [Common Lisp] hello CFFI (Common Lisp + C)

This is a practice project to test Common Lisp + C with CFFI.

CFFI is a protocal for common lisp, and most popular impl like sbcl,ccl,cmucl,ecl and abcl have to this. So We can eazy to access C code from Common Lisp.

Env need

just only write for Linux(Unix) and need a lisp impl with cffi package. I pratice it with sbcl. You can install it with Roswell, or you can also ues more friendly env - cl-repl which also can install by roswell.

  • OS: Linux(Unix)
  • A Common lisp impl with cffi
@leonklingele
leonklingele / client.sh
Last active July 19, 2023 20:35
netcat – encrypt transfer with openssl
IP="127.0.0.1"
PORT="8877"
SHARED_SECRET="shared secret"
OPENSSL="/usr/local/opt/libressl/bin/openssl"
OPENSSL_CMD="$OPENSSL enc -a -A -aes-256-gcm"
while IFS= read -r MSG; do
echo "$MSG" | $OPENSSL_CMD -e -k "$SHARED_SECRET"
echo
@timothypratley
timothypratley / forshame.md
Last active June 11, 2021 05:06
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
viperscape / core.clj
Created September 3, 2014 15:59
async chans and kuroshio streams
(ns chan-test.core
(:gen-class)
(: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
alanhamlett / api.py
Last active October 21, 2024 14:30
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
pauloborges / decorators.py
Last active December 10, 2015 18:38
@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