Skip to content

Instantly share code, notes, and snippets.

View einaralex's full-sized avatar
🐕

Einar Alexander Eymundsson einaralex

🐕
View GitHub Profile
@einaralex
einaralex / gitBranchAuto.txt
Created May 18, 2014 16:32
Git branch name autocompletion OSX
Grab git-completion.bash (https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash)
and save it to /Users/YourUser/.git_completion.bash
Then in your ~/.bashrc file, add
source $HOME/.git_completion.bash
Then in your shell, pickup the changes:
source ~/.bashrc
If this doesn't work off the bat, you may need to run
@einaralex
einaralex / SwiftKey-Icelandic-iOS-8
Created April 22, 2015 18:45
SwiftKey-Icelandic-iOS-8
Icelandic keyboard as default for SwiftKey (for iOS)
Edit name of original file for backup and add this one at:
/var/mobile/Containers/Bundle/Application/ < uuid > /SwiftKeyApp.app/Frameworks/SKKit.framework
(in iFile, go to settings and turn on 'Application Names' to replace the uuid with 'SwiftKey'.)
charactermap_base_accents.json
-----
@einaralex
einaralex / SetHeaders.groovy
Created July 19, 2017 14:38
Set headers script for SoapUI
import com.eviware.soapui.support.types.StringToStringMap
import com.eviware.soapui.impl.wsdl.teststeps.*
// loop through every teststep in that testcase
for(testStep in testRunner.testCase.getTestStepList()){
if(testStep instanceof WsdlTestRequestStep) {
def headers = new StringToStringMap()
headers.put("X-End-User","User")
headers.put("X-Audit-Guid","\${=java.util.UUID.randomUUID().toString().replace(\"-\",\"\").toUpperCase()}")
@einaralex
einaralex / callablestatement.java
Created August 9, 2017 14:49
Calling a DB procedure that returns a cursor (Jmeter - Beanshell sampler)
import java.sql.*;
import oracle.jdbc.*;
import org.apache.jmeter.protocol.jdbc.config.DataSourceElement;
ResultSet rs = null;
ResultSetMetaData rsmd = null;
CallableStatement stmt;
// "myConnectionConfigName" is the variable name declaired in the 'JDBC Connection Configuration'
Connection conn = DataSourceElement.getConnection("myConnectionConfigName");
@einaralex
einaralex / JDBC-sampler-to-CSV.groovy
Last active October 4, 2017 15:59
JMeter - JDBC Sampler output to .csv file
// Set "Result variable name" as "resultList" in JDBC Sampler
resultSet = vars.getObject("resultList")
result = new StringBuilder()
// result.append("Header1,Header2,...,\r\n");
for (Object row : resultSet ) {
iter = row.entrySet().iterator()
while (iter.hasNext()) {
pair = iter.next()
set "PATH=%ConEmuDrive%\Program Files\Git\usr\bin;%PATH%" & "%ConEmuDrive%\Program Files\Git\git-cmd.exe" --no-cd --command=%ConEmuBaseDirShort%\conemu-msys2-64.exe /usr/bin/bash.exe -l -i -new_console:a
type Address {
PartnerCode: ID
FullName: String
AddressType: String
Address1: String
Address2: String
Address3: String
Address4: String
PointCode: String
PostCode: String
@einaralex
einaralex / client.html
Last active March 18, 2019 16:19
Client bundles 18.03.19
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Webpack Bundle Analyzer</title>
<!-- viewer.js -->
<script>

Keybase proof

I hereby claim:

  • I am einaralex on github.
  • I am einaralex (https://keybase.io/einaralex) on keybase.
  • I have a public key ASCuk9Dj226VdM8R21_xFQM4_OsMO264Pjss6cXr7xMGLAo

To claim this, I am signing this object:

@einaralex
einaralex / gist:34b9ccb64e59ad6808f6c4a4580cf834
Created August 28, 2019 23:13
copy files with structure
// This script takes fromFolder, toFolder and a fileType
// it finds all files of the fileType in fromFolder and copies it to toFolder
// there is something wrong with how the path is resolved if the fromFolder does not exist
const glob = require('glob');
const fs = require('fs');
const path = require('path');
const fromFolder = process.argv[2] || 'src';
const toFolder = process.argv[3] || 'dist';