Skip to content

Instantly share code, notes, and snippets.

View delphym's full-sized avatar

DelphyM delphym

View GitHub Profile
@delphym
delphym / README.md
Last active July 31, 2019 10:03 — forked from matijs/README.md
Solarized Dark profile for macOS Terminal.app

Solarized Dark profile for Terminal.app on macOS High Sierra

Based on the excellent Solarized (Dark) created by Ethan Schoonover. For source code, check the main Solarized repository on GitHub.

Installation

Open and save Solarized Dark.terminal.

Import from the “Profiles” tab in the settings of Terminal.app or just double-click the file after downloading.

@delphym
delphym / fix-git-line-endings
Last active September 12, 2019 01:26 — forked from ajdruff/fix-git-line-endings
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@delphym
delphym / Jenkins+Script+Console.md
Created April 1, 2020 20:18 — forked from mubbashir/Jenkins+Script+Console.md
jenkins groovy scripts collection.
@delphym
delphym / BSG_reposUpdate.sh
Last active July 29, 2021 02:15
GIT Repos update and bulk checkout
#!/bin/bash
changed=`tempfile -p changed -s .txt` # For macOs, see: https://stackoverflow.com/q/19408005/2234369
nochanges=`tempfile -p nochanges -s .txt`
updated=`tempfile -p updated -s .txt`
cantupd=`tempfile -p cantupd -s .txt`
notonAKAdev=`tempfile -p notonAKAdev -s .txt`
switchedto=`tempfile -p switchedto -s .txt`
failedtoswitch=`tempfile -p failedtoswitch -s .txt`
# Setting default values
@delphym
delphym / compress-pdf-with-gs.md
Created June 3, 2021 09:52 — forked from vibegui/compress-pdf-with-gs.md
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
@delphym
delphym / openvpn.sh
Last active September 13, 2021 04:12
Control openVPN client
#!/bin/bash
# https://www.aandcp.com/launchdaemons-and-mac-os-x-openvpn-as-an-example
### FURTHER TUNNELING ############################
# You can enable unreachable URLs by
# Pick the host from the URI you can't reach and find its IPs by running, e.g.
# dig vw-bellhop.test.bussys.trimble.com +noall +answer
# Then followed by for each IP address, add the route
# sudo route add 44.236.79.253/32 -interface utun0
#
@delphym
delphym / DAOTests.java
Last active February 2, 2022 01:50
HOWTO execute CREATE PROCEDURE statement (from a file or String) in Spring Boot FW
// import(s) are omitted
@SpringBootTest
@Log4J2
class DAOTests {
JdbcTemplate jdbcTemplate;
@Autowired DataSource testSetupDataSource;
@BeforeEach
void setup1() throws SQLException { //using Java String & JdbcTemplate
jdbcTemplate = new JdbcTemplate(testSetupDataSource);
@delphym
delphym / DBquerryAsListTest.java
Created February 9, 2022 03:10
To demonstrate how to run simple SELECT statement and get result back as a list of defined object models.
@SpringBootTest
class DBquerryAsListTest {
@Autowired
@Qualifier("testSetupDataSource")
DataSource testSetupDataSource;
JdbcTemplate jdbcTemplate;
@Test
@delphym
delphym / install-zsh-windows-git-bash.md
Last active March 1, 2025 19:45 — forked from fworks/install-zsh-windows-git-bash.md
Zsh / Oh-my-zsh on Windows Git Bash
@delphym
delphym / RequestHandler.java
Last active May 9, 2023 03:43
Lambda Expressions with Streams magics
@Component
@Scope("prototype")
public class RequestHandler extends BaseRequestHandler<List<PositionEstablishment>> {
@Autowired
private PositionEstablishmentRepository positionEstablishmentRepository;
Date asAtDate;
private List<com.jemini.base.model.position.PositionEstablishment> establishments = new ArrayList<>();
private List<PositionDateEffective> positionDateEffectives;
public Date getAsAtDate() {return asAtDate;}