Skip to content

Instantly share code, notes, and snippets.

@br3ndonland
br3ndonland / github-actions-notes.md
Last active May 5, 2024 07:39
Getting the Gist of GitHub Actions
@mcquinne
mcquinne / GStringJsonSerializer.groovy
Last active May 2, 2022 20:35
Spring Jackson JSON serializer for Groovy GStrings
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.core.JsonProcessingException
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializerProvider
import com.fasterxml.jackson.databind.module.SimpleModule
import com.fasterxml.jackson.databind.ser.std.StdSerializer
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
@Component
@enthal
enthal / .profile
Last active February 17, 2017 23:44
.profile of ♡
echo bash
parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'; }
PS1="________________________________________________________\n\u@\h \w\[\e[0;33;49m\]\$(parse_git_branch)\[\e[0;0m\]\n\$ "
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
if [ -f `brew --prefix`/etc/bash_completion ]; then
@vectorsize
vectorsize / linearScale.js
Last active December 20, 2022 14:30
Quick linear scale inspired by d3.js scales, based on the processing.org map() function.takes in an object with a domain array and a rage array, gives you back a function that receives a value and returns the scaled value.
// based on https://github.com/processing/processing/blob/a6e0e227a948e7e2dc042c04504d6f5b8cf0c1a6/core/src/processing/core/PApplet.java#L5093
var scale = function(opts){
var istart = opts.domain[0],
istop = opts.domain[1],
ostart = opts.range[0],
ostop = opts.range[1];
return function scale(value) {
return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));
@enthal
enthal / index.html
Created February 2, 2012 23:51
Example of continuous function graphing in d3 (using axis() for axes and grid lines)
<!DOCTYPE html>
<html>
<head>
<title>D3 - Line Chart - continuous function</title>
<!-- script type="text/javascript" src="https://raw.github.com/jquery/sizzle/master/sizzle.js"></script -->
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.min.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.time.min.js"></script>
<style type="text/css">
body {
@enthal
enthal / .bashrc
Created January 16, 2012 21:24
.bashrc
export PATH=/usr/local/bin:/usr/local/git/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
# export JAVA_HOME=$(/usr/libexec/java_home)
# export LD_LIBRARY_PATH=/usr/local/lib/
alias ll='ls -al'
alias m='mate'
alias mw='mate -w'
alias .p='. ~/.bashrc'
alias ep='mw ~/.bashrc; .p'
@mbostock
mbostock / .block
Last active November 22, 2016 21:05
Line Tension
license: gpl-3.0