Skip to content

Instantly share code, notes, and snippets.

View JasonGiedymin's full-sized avatar
🏠
Working from home

Jason Giedymin JasonGiedymin

🏠
Working from home
View GitHub Profile
@kwilczynski
kwilczynski / mesos-detect-java.sh
Last active March 21, 2021 21:28
Detect Java JVM home in Bash shell before starting Mesos
#!/bin/bash
java_binary_link="/usr/bin/java"
java_library="libjvm.so"
library_paths=(
/jre/lib/amd64/server
/jre/lib/amd64/client
/usr/lib
/lib
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active June 5, 2024 06:45
A badass list of frontend development resources I collected over time.

This is a temporary workaround to have etcd listening on all interfaces so you can access it from docker containers.

Add a local etcd unit file

Create a file called /media/state/units/etcd-local.service that has the following contents:

[Unit]
Description=etcd local
@plentz
plentz / nginx.conf
Last active June 9, 2024 13:18
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@aloiscochard
aloiscochard / Action.scala
Created December 1, 2013 10:39
Slick monadic Actions
package slick
/**
* This is some code extracted from TimeOut codebase, demonstrating:
* - Use of tag typed to avoid mixing session of different DB
* - The use of the Reader Monad to compose Actions together and defer the choice of async/sync computation
*
* I remove the part where we can say if our operation are read only or not (to use different connection), in order to
* make things easier.
**/
@adrianseeley
adrianseeley / pso.js
Last active June 5, 2021 12:03
JavaScript Normalized Particle Swarm Optimization Implementation - Search for an N-dimensional vector of components between -1 and +1 that optimizes a given function to a fitness of 0.
// based on http://msdn.microsoft.com/en-us/magazine/hh335067.aspx
// usage example at bottom
function pso (number_of_dimensions, function_to_optimize, number_of_particles, number_of_iterations, fitness_threshold, inertia_weight, cognitive_weight, social_weight) {
var particles = [];
var swarm_best_position = [];
var swarm_best_fitness = null;
for (var p = 0; p < number_of_particles; p++) {
particles.push({
particle_position: [],