Skip to content

Instantly share code, notes, and snippets.

View jimleroyer's full-sized avatar
🏊

Jimmy Royer jimleroyer

🏊
View GitHub Profile
@garrettmac
garrettmac / app.js
Last active July 21, 2017 18:31
simple gulp recipe to sever any projects dist folder with express & node. Just add these to a project then move any project you'd like to server at the root and rename the folder 'frontend' and you're done
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
// res.sendfile('./public/index.html');
@ctranxuan
ctranxuan / Configurations.md
Last active November 21, 2017 23:32
SpringBoot things

How to load @ConfigurationProperties manually from a Yaml configuration file

Let's say we have the following yaml configuration file:

foo:
    apis:
      -
        name: Happy Api
 path: /happyApi.json?v=bar

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@SethTisue
SethTisue / scalawags-38.md
Last active July 3, 2016 09:17
Scalawags #38: The Sound of Dotty
function Add-EnvPath {
param(
[Parameter(Mandatory=$true)]
[string] $Path,
[ValidateSet('Machine', 'User', 'Session')]
[string] $Container = 'Session'
)
if ($Container -ne 'Session') {
@nsdiv
nsdiv / gist:9effb78e27ff6ca94381
Created November 7, 2015 00:37
Mock MongoDB when unit testing services with Spring Boot
If you are using Spring Boot with MongoDB, then a MongoDB connection is required even if you are unit testing a function.
Spring creates a connection to mongoDB during start up, because of Autowired beans in your code. This slows down your unit tests, and
also means your unit tests require access to the MongoDB server.
Here is what you need to do:
1. Mock the beans created by org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration:
@Bean
public MongoDbFactory mongoDbFactory(){
return null;
}
@alkrauss48
alkrauss48 / gulpfile.js
Last active February 17, 2020 12:45
Base gulpfile config for babel, browserify, and uglify - with sourcemaps and livereload
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var livereload = require('gulp-livereload');
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Firefox()
driver.get('http://google.com')
# Log in to the developer console.
driver.find_element_by_id('Email').send_keys(args.google_email)
driver.find_element_by_id('Passwd').send_keys(args.google_password)
driver.find_element_by_id('Passwd').send_keys(Keys.RETURN)
@rhyzx
rhyzx / selectize.js
Created July 11, 2014 09:06
disable Selectize sifter search engine
Selectize.prototype.search = function (query) {
return {
query: query,
tokens: [], // disable highlight
items: $.map(this.options, function (item, key) {
return {id: key}
})
}
}