Skip to content

Instantly share code, notes, and snippets.

View alex0112's full-sized avatar
πŸ’­
Mapping syntactic content to semantic content

Alex Larsen alex0112

πŸ’­
Mapping syntactic content to semantic content
View GitHub Profile
@widdowquinn
widdowquinn / emacs_python_ide.md
Last active May 13, 2025 17:53
Turning Emacs into a Python IDE

Turning emacs into a Python IDE

##Β Create a new config/initialisation file

Create a user-level initialisation file init.el:

touch .emacs.d/init.el
@theriley106
theriley106 / patd.py
Created February 9, 2018 14:20
Script used to get the data in this dataset: https://www.kaggle.com/theriley106/panic-at-the-dataset/
import requests
import bs4
import re
import json
from textblob import TextBlob
def getLyricSentiment(lyrics):
lyrics = re.sub('\s+',' ',lyrics)
return TextBlob(lyrics).sentiment.polarity
@cscalfani
cscalfani / ThinkAboutMonads.md
Last active December 4, 2022 20:58
How to think about monads

How to think about Monads

UPDATE 2021: I wrote this long before I wrote my book Functional Programming Made Easier: A Step-by-step Guide. For a much more in depth discussion on Monads see Chapter 18.

Initially, Monads are the biggest, scariest thing about Functional Programming and especially Haskell. I've used monads for quite some time now, but I didn't have a very good model for what they really are. I read Philip Wadler's paper Monads for functional programming and I still didnt quite see the pattern.

It wasn't until I read the blog post You Could Have Invented Monads! (And Maybe You Already Have.) that I started to see things more clearly.

This is a distillation of those works and most likely an oversimplification in an attempt to make things easier to understand. Nuance can come later. What we need when first le

@CodyReichert
CodyReichert / react-es6-flow-emacs-configuration.md
Last active June 21, 2025 13:28
Configuring Emacs for react, es6, and flow

Configuring Emacs for react, es6, and flow

For a while, JSX and new es6 syntax had flaky support in emacs, but there's been huge work on a lot of packages. Using emacs for JavaScript with React, ES6, and Flow (or Typescript, etc) is really easy and powerful in Emacs these days.

This is how you can work on modern web development projects with full support for tooling like JSX, Flow types, live eslint errors, automatic prettier.js formatting, and more.

Set up web-mode

web-mode provides most of the underlying functionality, so a huge shout-out to the maintainer(s) there.

@jasny
jasny / sha256-hmac.md
Last active July 16, 2025 12:32
Hashing examples in different languages

Example inputs:

Variable Value
key the shared secret key here
message the message to hash here

Reference outputs for example inputs above:

| Type | Hash |

@githubfoam
githubfoam / sed cheat sheet
Last active September 11, 2025 06:18
sed cheat sheet
------------------------------------------------------------------------------------------
curl -I -sS http://localhost:7777 | sed -n '1,6p'
curl β†’ makes a request to the given URL.
-I β†’ fetches only the HTTP headers (HEAD request instead of GET).
-sS β†’ silent mode (hides progress bar), but still shows errors if they occur.
http://localhost:7777 β†’ target URL (your web server running on port 7777).
@lamarmarshall
lamarmarshall / main.cpp
Created October 23, 2020 04:09
C++, lambda, map, filter, reduce
//
// main.cpp
// tutorial
//
// Created by king lamar on 10/22/20.
//
#include <iostream>
#include <vector>
#include <random>
@PJUllrich
PJUllrich / big-o.md
Last active December 14, 2025 22:47
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for <= 32 elements, O(log n) for > 32 elements [2]
Deletion O(n) for <= 32 elements, O(log n) for > 32 elements
@MikaAK
MikaAK / big-o.md
Created April 25, 2022 18:28 — forked from PJUllrich/big-o.md
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for < 32 elements, O(log n) for >= 32 elements [2]
Deletion O(n) for < 32 elements, O(log n) for >= 32 elements
(?i)((access_key|access_token|admin_pass|admin_user|algolia_admin_key|algolia_api_key|alias_pass|alicloud_access_key|amazon_secret_access_key|amazonaws|ansible_vault_password|aos_key|api_key|api_key_secret|api_key_sid|api_secret|api.googlemaps AIza|apidocs|apikey|apiSecret|app_debug|app_id|app_key|app_log_level|app_secret|appkey|appkeysecret|application_key|appsecret|appspot|auth_token|authorizationToken|authsecret|aws_access|aws_access_key_id|aws_bucket|aws_key|aws_secret|aws_secret_key|aws_token|AWSSecretKey|b2_app_key|bashrc password|bintray_apikey|bintray_gpg_password|bintray_key|bintraykey|bluemix_api_key|bluemix_pass|browserstack_access_key|bucket_password|bucketeer_aws_access_key_id|bucketeer_aws_secret_access_key|built_branch_deploy_key|bx_password|cache_driver|cache_s3_secret_key|cattle_access_key|cattle_secret_key|certificate_password|ci_deploy_password|client_secret|client_zpk_secret_key|clojars_password|cloud_api_key|cloud_watch_aws_access_key|cloudant_password|cloudflare_api_key|cloudflare_auth_k