Skip to content

Instantly share code, notes, and snippets.

View simonkberg's full-sized avatar
:shipit:

Simon Kjellberg simonkberg

:shipit:
View GitHub Profile
@dmcg
dmcg / gist:8ddf275688fd450e977e
Last active February 20, 2025 12:41
Hamcrest Matcher transformed by function
public class TransformingMatcher<U, T> extends TypeSafeMatcher<U> {
private final Matcher<T> base;
private final Function<? super U, ? extends T> function;
public TransformingMatcher(Matcher<T> base, Function<? super U, ? extends T> function) {
this.base = base;
this.function = function;
}
@Override
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@keirlawson
keirlawson / installkeyringhelper.sh
Created February 21, 2016 10:36
Install gnome-keyring git credential helper in Ubuntu
sudo apt-get install libgnome-keyring-dev
cd /usr/share/doc/git/contrib/credential/gnome-keyring
sudo make
sudo ln -s /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring /usr/lib/git-core/
@taion
taion / async-props-style.js
Last active January 24, 2017 17:14
React Router data fetching
// Define your components like:
class MyComponent extends React.Component {
static fetchData = (params) => {
// return an action here.
};
/* ... */
}
function fetchComponentData(component, store, params) {
@louisremi
louisremi / lru.js
Created May 17, 2016 15:38
Last Result Used
function LRU(limit) {
this.limit = limit || 1000;
this.map = new Map();
}
LRU.prototype.has = function(key) {
return this.map.has(key);
}
LRU.prototype.set = function(key, value) {
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active September 27, 2025 02:50
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@aviskase
aviskase / Postman.desktop
Last active January 22, 2025 01:08
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/home/USERNAME/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
@joestrong
joestrong / Guide.md
Last active September 16, 2020 21:29
Linux Emoji Support

Install fonts:

  • Bitstream Vera
  • Noto Color Emoji

We set these fonts as the fallbacks, bitstream has the normal characters, Noto has the emoji

We don't want DejaVu to be used as a fallback, as this has overriding emoji

@sandor-nemeth
sandor-nemeth / PropertyLogger.java
Last active October 14, 2025 12:05
Spring Boot - Log all configuration properties on application startup
package io.github.sandornemeth.spring;
import java.util.Arrays;
import java.util.stream.StreamSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.core.env.AbstractEnvironment;
@jlengstorf
jlengstorf / *README.md
Last active March 21, 2018 13:36
Create custom git.io short links by adding this helper function to your `.bash_profile`

Create Custom git.io Short Links

Add this helper function to your ~/.bash_profile (or ~/.bashrc, or whatever you use) to create custom short links for your GitHub projects without having to remember the whole cURL command!

Installation

If you use a file other than ~/.bash_profile to configure your terminal, substitute that value in the installation instructions below.

  1. Open your ~/.bash_profile
  2. Copy-paste the gitlink function into it