Skip to content

Instantly share code, notes, and snippets.

💭
Everything not saved will be lost

Alif h4ck4life

💭
Everything not saved will be lost
Block or report user

Report or block h4ck4life

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@h4ck4life
h4ck4life / Chromeoptions.cs
Created Jan 20, 2020
Selenium ChromeDriver necessary options to reduce flaky testing
View Chromeoptions.cs
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.AddArgument("--disable-notifications");
chromeOptions.AddArguments("start-maximized");
chromeOptions.AddArguments("--disable-extensions");
chromeOptions.AddArguments("no-sandbox");
chromeOptions.AddArguments("--ignore-certificate-errors");
chromeOptions.AddArguments("--incognito");
@h4ck4life
h4ck4life / TrxSummary.java
Last active Jan 1, 2020
Read TRX result file and output with test summary into plain csv
View TrxSummary.java
import java.io.FileInputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@h4ck4life
h4ck4life / TikaExtractor.java
Created Jan 1, 2020 — forked from LorisBachert/TikaExtractor.java
Using Apache TIKA to extract the following formats: DOC, DOCX, PPT, PPTX, XLS, XLSX, PDF, JPG, PNG, TXT Note: Tesseract must be installed in order to get JPG and PNG extraction working.
View TikaExtractor.java
/**
* Uses Tikas {@link AutoDetectParser} to extract the text of a file.
*
* @param document
* @return The text content of a file
*/
@Override
public String extractTextOfDocument(File file) throws Exception {
InputStream fileStream = new FileInputStream(file);
Parser parser = new AutoDetectParser();
@h4ck4life
h4ck4life / CallbackDemo.java
Created Nov 8, 2019
Java simple callback demo using Interface
View CallbackDemo.java
public class CallbackDemo {
public static void main(String[] args) throws InterruptedException {
RestApiCall restApiCall = new RestApiCall();
restApiCall.getUsersAsync(new UserListener() {
@Override
public void onDataReceived(String data) {
System.out.println(data);
}
@h4ck4life
h4ck4life / PreventSleep.cs
Created Nov 6, 2019 — forked from brianhassel/PreventSleep.cs
Prevent Computer Sleep in C#
View PreventSleep.cs
internal static class NativeMethods {
public static void PreventSleep() {
SetThreadExecutionState(ExecutionState.EsContinuous | ExecutionState.EsSystemRequired);
}
public static void AllowSleep() {
SetThreadExecutionState(ExecutionState.EsContinuous);
}
@h4ck4life
h4ck4life / vpn.md
Created Oct 23, 2019 — forked from joepie91/vpn.md
Don't use VPN services.
View vpn.md

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

A Russian translation of this article can be found here, contributed by Timur Demin. There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.

Why not?

@h4ck4life
h4ck4life / deployment-tool-ansible-puppet-chef-salt.md
Created Oct 22, 2019 — forked from jaceklaskowski/deployment-tool-ansible-puppet-chef-salt.md
Choosing a deployment tool - ansible vs puppet vs chef vs salt
View deployment-tool-ansible-puppet-chef-salt.md

Requirements

  • no upfront installation/agents on remote/slave machines - ssh should be enough
  • application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
  • configuration templating
  • environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
  • deployment process run from Jenkins

Solution

@h4ck4life
h4ck4life / media-query.css
Created Sep 10, 2019 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
View media-query.css
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@h4ck4life
h4ck4life / .gitignore
Created Jul 23, 2019 — forked from mchelen/.gitignore
example: browserify + jquery + grunt
View .gitignore
*~
bundle.js
bundle.min.js
node_modules
@h4ck4life
h4ck4life / dev-machine.sh
Created Jun 26, 2019
Install all the necessary tools for a developer machine on Ubuntu 14.04
View dev-machine.sh
#!/bin/bash
# All the configuration settings described below were found on the internet,
# and this script just automates it
# Generating locales
sudo locale-gen en_US en_US.UTF-8 pt_BR pt_BR.UTF-8 es_ES es_ES.UTF-8
# Installing base packages
sudo apt-get update
You can’t perform that action at this time.