Skip to content

Instantly share code, notes, and snippets.

View baxtheman's full-sized avatar

Daniele Baggio baxtheman

View GitHub Profile
@2sbsbsb
2sbsbsb / HTMLTableBuilder.java
Created June 18, 2012 23:43
Simple HTML Table Builder
/**
* Uses:
* HTMLTableBuilder htmlBuilder = new HTMLTableBuilder(null, true, 2, 3);
* htmlBuilder.addTableHeader("1H", "2H", "3H");
* htmlBuilder.addRowValues("1", "2", "3");
* htmlBuilder.addRowValues("4", "5", "6");
* htmlBuilder.addRowValues("9", "8", "7");
* String table = htmlBuilder.build();
* System.out.println(table.toString());
*/
OS=`echo \`uname\` | tr '[:upper:]' '[:lower:]'`
AURL="https://gist.githubusercontent.com/hightemp/5071909/raw/"
ANAME=".bash_aliases"
TMPAPATH="/tmp/$ANAME"
HOMEAPATH="~/$ANAME"
[ "$OS" = "windowsnt" ] && OS_WIN="yes"
[ "$OS" = "darwin" ] && OS_MAC="yes"
[ "$OS" = "linux" ] && OS_LIN="yes"
@baxtheman
baxtheman / config.properties
Last active December 17, 2015 19:58
import_lars properties file sample
#
# file properties to run the import_lars.jar
#
#
# WS connection data
#
protocol=http
@bitdivine
bitdivine / gist:3366f3d21e025cac3b83
Created April 15, 2015 19:50
Reverse proxy InfluxDB on Apache
<VirtualHost *:80>
ServerName your.host.com
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
# Rewrite links to 8086 on the way out:
@0XDE57
0XDE57 / config.md
Last active October 20, 2024 13:07
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@kgolebiowski
kgolebiowski / logging.properties
Last active February 25, 2018 10:46
Improved Tomcat logging for Liferay 6.2 (copy to liferay-portal-6.2-ce-ga5/tomcat-7.0.62/conf/logging.properties)
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@cyrille-leclerc
cyrille-leclerc / pipeline.groovy
Last active March 9, 2022 23:41
Escape character & quotes in Jenkins Pipeline
docker.image('cloudbees/java-build-tools:0.0.6').inside {
sshagent(['github-ssh-credentials']) {
sh """
git version
git config --local user.email \\"[email protected]\\"
git config --local user.name \\"Cyrille Le Clerc\\"
git clone [email protected]:cyrille-leclerc/a-test-repo.git
date &> now.txt
@pathikrit
pathikrit / NQueen.scala
Last active January 19, 2023 21:30
O(n!) solution to the n-Queen puzzle (https://en.wikipedia.org/wiki/Eight_queens_puzzle)
/**
* Solves the n-Queen puzzle in O(n!)
* Let p[r] be the column of the queen on the rth row (must be exactly 1 queen per row)
* There also must be exactly 1 queen per column and hence p must be a permuation of (0 until n)
* There must be n distinct (col + diag) and n distinct (col - diag) for each queen (else bishop attacks)
* @return returns a Iterator of solutions
* Each solution is an array p of length n such that p[i] is the column of the queen on the ith row
*/
def nQueens(n: Int): Iterator[Seq[Int]] =
(0 until n)
@alekseykulikov
alekseykulikov / index.md
Last active October 12, 2024 17:02
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@kiview
kiview / docker_volume_backup.sh
Last active October 24, 2024 18:36
Docker-Compose volume backup
#!/bin/bash
compose_file_path=$1
project_name=$2
backup_path=$3
function backup_volume {
volume_name=$1
backup_destination=$2