Skip to content

Instantly share code, notes, and snippets.

View jimador's full-sized avatar

James Dunnam jimador

  • Charleston, SC
View GitHub Profile
@jimador
jimador / .zshrc
Created July 31, 2020 20:18 — forked from QinMing/.zshrc
.zshrc (lazy loading shell functions)
# Copyright (c) 2016-2018 Ming Qin (覃明) <https://github.com/QinMing>
# Open source under MIT LICENSE.
ZSH_THEME="agnoster"
plugins=(zsh-autosuggestions git pip django docker docker-compose)
# ......
unsetopt AUTO_CD
# AUTO_CD: if the command isn't found in the current directory, the shell will automatically cd into the command name, if the directory is found.
import org.springframework.util.ClassUtils;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory;
import java.util.concurrent.ForkJoinWorkerThread;
import java.util.concurrent.atomic.AtomicInteger;
/**
* {@link ForkJoinPool.ForkJoinWorkerThreadFactory} allowing for the creation of {@link ForkJoinWorkerThread}s with a
* custom name.
@jimador
jimador / quick_approve.js
Created May 21, 2020 12:54 — forked from lamp/quick_approve.js
Mark All Issues on codeclimate as wontfix
$('li[data-issue-status-name="wontfix"]').each((i, e) => { e.click() })
$('input[name="commit"]').each((i, e) => { e.click() })
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
public final class TypeHandler<R> implements Function<Object, R> {
private final Map<Class<?>, Function<Object, R>> fMap = new HashMap<>();
private TypeHandler() {}
@jimador
jimador / SecurityConfiguration.java
Last active October 10, 2016 20:11
Spring Boot Security config
import com.asi.hrportal.security.*;
import com.asi.hrportal.web.filter.CsrfCookieGeneratorFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
@jimador
jimador / word-counter.clj
Created May 11, 2016 21:49
Wasting time when I should be going home
(ns playground.word-counter)
(def articles #{"a" "an" "the"})
(defn- weighted-count [count total]
(.doubleValue (+ count (* count (/ count total)))))
(defn- weighted-list [coll total]
(map (fn [x] (weighted-count (second x) total)) coll))
package com.transcoding.tester;
import org.bytedeco.javacpp.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;