Skip to content

Instantly share code, notes, and snippets.

View jtammen's full-sized avatar

Jan Tammen jtammen

View GitHub Profile
@gwpantazes
gwpantazes / How to Install JDK MacOS Homebrew.md
Last active April 18, 2024 21:43
How to install different JDK versions on MacOS with Homebrew

How To Install Different JDK Versions on MacOS with Homebrew

Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version

This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.

Table of Contents

@ravibhure
ravibhure / git_rebase.md
Last active April 3, 2024 08:38
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@kloudsamurai
kloudsamurai / java_homebrew.sh
Last active September 10, 2021 13:53
Install Java via Homebrew (brew) on Mac OSX with unlimited strength JCE
brew update
brew cask install java
brew cask install jce-unlimited-strength-policy
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
@subfuzion
subfuzion / Makefile.md
Last active October 18, 2023 14:49
Makefile for Go projects

Go has excellent build tools that mitigate the need for using make. For example, go install won't update the target unless it's older than the source files.

However, a Makefile can be convenient for wrapping Go commands with specific build targets that simplify usage on the command line. Since most of the targets are "phony", it's up to you to weigh the pros and cons of having a dependency on make versus using a shell script. For the simplicity of being able to specify targets that can be chained and can take advantage of make's chained targets,

@lokhman
lokhman / ubuntu-hardening.md
Last active April 23, 2024 09:05
List of things for hardening Ubuntu

WARNING

May contain out of date information. Check the comments below!

The list of actions listed below was taken mostly from Book Of Zeus with minor modifications and did the job well for Ubuntu version, which was available at that moment (May 2016). This gist was created for internal use and was never meant to be discovered by the web, although Google managed to find and index this page, which was a great surprise for me. Please check the original source for the updated information (links are provided in most of the sections), and read the comments below: they provide more details about the usage experience.

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

@navad
navad / ng-grunticon-embed.directive.js
Last active October 9, 2016 02:25
Grunticon embedder for use in Angular directives/templates
/* globals grunticon: false */
(function() {
'use strict';
angular.module('ngGrunticon', [])
.provider('grunticonEmbedConfig', function() {
this.gruntIcons = undefined;
this.init = function(grunticonCss) {
@softwarespot
softwarespot / .jsbeautifyrc
Last active January 8, 2023 10:42
JS Beautifier configuration
// Documentation: https://github.com/beautify-web/js-beautify
// Example URL: https://github.com/victorporof/Sublime-HTMLPrettify/blob/master/.jsbeautifyrc
// Based on Airbnb's JavaScript Style Guide, URL: https://github.com/airbnb/javascript
{
// Collapse curly brackets
"brace_style": "collapse",
// Break chained method calls across subsequent lines
"break_chained_methods": true,
@tkh44
tkh44 / animated-check.js
Last active March 28, 2020 22:33
Animated Checkmark Directive inspired by http://codepen.io/haniotis/pen/KwvYLO
angular.module('animated-checkmark', []).directive('animatedCheck', animatedCheck);
function animatedCheck() {
const svgTemplate = `
<div class="checkmark-container">
<svg class="checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
<g>
<circle class="checkmark-outline" cx="26" cy="26" r="25" fill="none" />
<circle class="checkmark-circle" cx="26" cy="26" r="25" fill="none" />
<path class="checkmark-check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8" />
</g>
@ipmb
ipmb / ratelimit.nginxconf
Last active April 5, 2024 00:46
Nginx reverse proxy with rate limiting
upstream myapp {
server 127.0.0.1:8081;
}
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
listen 443 ssl spdy;
server_name _;
@mauron85
mauron85 / nginx-lang.lua
Last active September 3, 2023 06:31
Detect preferred language script for Nginx written in LUA
-------------------------------------------------------------------------------
-- HTTP Accept-Language header handler --
-- @originalAuthor: f.ghibellini@gmail.com --
-- @originalRepository: https://github.com/fghibellini/nginx-http-accept-lang--
-- @modifiedBy: marian.hello@mapilary.com --
-- @gist: https://gist.github.com/mauron85/47ed1075262d9e020fe2 --
-- @license: MIT --
-- @requires: --
-- @description: --
-- returns language with greatest quality --