Skip to content

Instantly share code, notes, and snippets.

View serpro69's full-sized avatar
🍡
breaking things when they work, so I can fix them later

Særgeir serpro69

🍡
breaking things when they work, so I can fix them later
View GitHub Profile
@djangofan
djangofan / JenkinsHTMLReport.java
Last active April 18, 2017 05:39
Customized HTML report for TestNG for use on Jenkins job
package engine.test.selenium.common.helper;
import org.testng.IInvokedMethod;
import org.testng.IReporter;
import org.testng.IResultMap;
import org.testng.ISuite;
import org.testng.ISuiteResult;
import org.testng.ITestClass;
import org.testng.ITestContext;
import org.testng.ITestNGMethod;
@ashrithr
ashrithr / YarnClientTest.java
Last active November 16, 2021 09:48
YarnClient example for deleteing user applications
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.api.records.YarnApplicationState;
import org.apache.hadoop.yarn.client.api.YarnClient;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.exceptions.YarnException;
@djangofan
djangofan / TestLogger.java
Created October 17, 2014 22:23
Logger that logs like Log4j but will also log TestNG static Reporter.log as well.
import org.testng.Reporter;
import java.io.File;
import java.util.Enumeration;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.log4j.Appender;
import org.apache.log4j.FileAppender;
import org.apache.log4j.Layout;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
@darekkay
darekkay / intellij-monokai-theme.xml
Last active February 19, 2025 03:01
Monokai Theme for JetBrains IDEs (IntelliJ IDEA, Webstorm, PhpStorm, PyCharm etc.)
<scheme name="Eclectide Monokai" version="142" parent_scheme="Default">
<colors>
<option name="ADDED_LINES_COLOR" value="295622" />
<option name="ANNOTATIONS_COLOR" value="b2c0c6" />
<option name="CARET_COLOR" value="bbbbbb" />
<option name="CARET_ROW_COLOR" value="" />
<option name="CONSOLE_BACKGROUND_KEY" value="1c1c1c" />
<option name="FILESTATUS_ADDED" value="629755" />
<option name="FILESTATUS_DELETED" value="6c6c6c" />
<option name="FILESTATUS_IDEA_FILESTATUS_DELETED_FROM_FILE_SYSTEM" value="6c6c6c" />
@cjaoude
cjaoude / gist:fd9910626629b53c4d25
Last active April 24, 2025 22:05
Test list of Valid and Invalid Email addresses
Use: for testing against email regex
ref: http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses
List of Valid Email Addresses
[email protected]
[email protected]
[email protected]
[email protected]
@ashrithr
ashrithr / FIleSystemOperations.java
Created February 26, 2015 01:27
HDFS FileSystems API example
package com.cloudwick.mapreduce.FileSystemAPI;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@carcinocron
carcinocron / debugger pause beforeunload
Last active April 28, 2025 12:59
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@makolesnik
makolesnik / Selenide cheat sheet
Last active December 26, 2022 13:57
Selenide cheat sheet to create concise UI tests in Java. What is Selenide? Selenide is a wrapper for Selenium WebDriver. http://selenide.org/
=Navigating=
baseUrl = "http://site.com";
open("/login");
open("http://google.com");
switchTo().frame($("#myFrame").toWebElement());
=Alert=
switchTo().alert().accept();
@squarism
squarism / iterm2.md
Last active April 24, 2025 04:38
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab ⌘ + T
Close Tab or Window ⌘ + W (same as many mac apps)
Go to Tab ⌘ + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction ⌘ + Option + Arrow Key
Cycle iTerm Windows ⌘ + backtick (true of all mac apps and works with desktops/mission control)
@kurobeats
kurobeats / mpdsetup.sh
Last active February 14, 2020 00:22
From http://dl.53280.de/mpdsetup.sh before it went down
#!/bin/bash
clear
username=$(whoami)
interface=`ip route show | cut -d ' ' -f 3 | head -1`
interface=$(ip route show | awk '{print $NF}' | tail -1)
echo "What is the full path of the directory containing your music?"
read -e -p "> " music_dir
if test -n "$(pgrep pulseaudio)";
then