Skip to content

Instantly share code, notes, and snippets.

View michaelsbradleyjr's full-sized avatar
💭
Dip trip, flip fantasia 🎺

Michael Bradley michaelsbradleyjr

💭
Dip trip, flip fantasia 🎺
View GitHub Profile
@digikar99
digikar99 / why-coalton-is-a-language.org
Last active November 5, 2023 07:26
An attempt at introducing Coalton to lispers without a background in ML-like languages

Coalton: Why is the interop not easier, and why might it be necessary for Coalton to be an entire language in itself?

If you came here searching for the context in which some reddit comments were written, you might want to check out this previous version of the article.

Several blog posts have been written about Coalton, about how it can be useful and what it brings to the table. However, to me, it hasn’t been clear why Coalton is the way to solve the problems that it does solve. Isn’t a simpler solution possible without making a full embedded language, and giving users the cognitive overhead of thinking about interop between normal lisp and coalton?

I have been thinking about this for a while as one of my pasttimes, and below I’ll summarize the better reasons why coalton might be the way it is. Perhaps, I couldn’t se

# nim c -r --threads:on --gc:orc
import cpuinfo, os, random, locks, deques
type
WorkReq = ref object
id: int
WorkRes = ref object
id: int
@pr1sm
pr1sm / updateNpm.bat
Last active March 10, 2019 16:43 — forked from johnmcase/updateNpm.bat
Update npm on windows
rem see https://github.com/coreybutler/nvm-windows/issues/300
@echo off
SETLOCAL EnableDelayedExpansion
if [%1] == [] (
echo Pass in the version you would like to install, or "latest" to install the latest npm version.
) else (
set wanted_version=%1
@johnmcase
johnmcase / updateNpm.bat
Last active October 6, 2022 16:28
Update npm on windows
rem see https://github.com/coreybutler/nvm-windows/issues/300
@echo off
SETLOCAL EnableDelayedExpansion
if [%1] == [] (
echo Pass in the version you would like to install, or "latest" to install the latest npm version.
) else (
set wanted_version=%1
@mplovepop
mplovepop / sqlfilequery.py
Created December 22, 2017 21:53
Utility class to load a named SQL file and use as a query
class SqlFileQuery:
"""Utility class to load a named SQL file and use as a query."""
def __init__(self, filename):
self.filename = filename
@property
def dirpath(self):
return os.path.dirname(os.path.realpath(__file__))
@property
def filepath(self):
return os.path.join(self.dirpath, self.filename)
@rushilgupta
rushilgupta / GoConcurrency.md
Last active May 14, 2024 06:30
Concurrency in golang and a mini Load-balancer

INTRO

Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".

Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).

Let's dig in:

Goroutines

@aturley
aturley / pony-considerations.md
Last active March 17, 2023 03:21
Information about Pony based on the items outlined in https://twitter.com/casio_juarez/status/898706225642086400

Pony Considerations

If you're thinking of checking out the Pony programming language, here's a list of things that I think are important to know. This list is based on a Tweet that I wrote.

Editor/IDE support

There are Pony packages for several popular editors.

@jangko
jangko / Sample1.java
Last active April 12, 2020 19:17
JNI Example
public class Sample1
{
public native int intMethod(int n);
public native boolean booleanMethod(boolean bool);
public native String stringMethod(String text);
public native int intArrayMethod(int[] intArray);
public static void main(String[] args)
{
System.loadLibrary("Sample1");
library(rvest)
library(tidyr)
library(splines)
library(stringr)
library(ggplot2)
library(dplyr)
setwd("C:/Dropbox/Projects/20160705_Calories_Per_Meal")
men = read_html("http://health.gov/dietaryguidelines/2015/guidelines/appendix-2/") %>%
@cherta
cherta / actionCreators.js
Created January 19, 2016 17:19
redux-simple-router and sagas
export function retrieve(nodeId) {
return { type: 'RETRIEVE_NODE', payload: { nodeId: nodeId } }
}
export function show(nodes) {
return { type: 'SHOW_NODE', payload: { nodes: nodes } }
}