This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* for this one, we were entering text to a textarea element, and it was being stored as the element's value. Selenium | |
* is fast enough that it will do this, then move on the the next bit of code (usually clicking a save or done button) | |
* before JS has updated the value with the text. Its tempting to use a Thread.sleep, but using Selenium's built-in | |
* waits, we can handle this */ | |
el(socialIconUrlInput).sendKeys(url); | |
wait.until(ExpectedConditions.textToBePresentInElementValue(socialIconUrlInput, url)); //now we're sure its ok to move on | |
clickElement(el(doneButton)); | |
/* in this case, a button was being clicked that caused a list of options to change in the UI. These option buttons were | |
* being removed, then replaced with the new ones when the button was clicked (which gets done via JS). Selenium would |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#deletes all branches that have been merged into master (except your current branch) (substitute "master" for whatever branch you want to clean against) | |
git branch --merged master | grep -v "\*" | xargs -n 1 git branch -d | |
#you can leave off the last command to just list them |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (3 != 3) | |
{ | |
fail("equality check failed on 3"); | |
} | |
/* | |
* That's fine, except that we're usually comparing dynamic data retrieved from the app. | |
* Sometimes we aren't even comparing against static data | |
*/ | |
for (String result : results) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# Usage: | |
# run with no args to toggle between on and off | |
# pass a single arg "on" or "off" to do exactly what you'd expect | |
# drop it in ~/bin with a nice name (I have ~/bin/tp) or bind it to a hotkey or something like that | |
function turn-on | |
echo "turning on" | |
synclient touchpadoff=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun beginning-of-line-or-indentation () | |
"Move to beginning of line, or indentation." | |
(interactive) | |
(let ((start (point))) | |
(back-to-indentation) | |
;; now if point is the same as when we started, we're already at indent start | |
(if (= start (point)) | |
(beginning-of-line)))) | |
(global-set-key (kbd "C-a") 'beginning-of-line-or-indentation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
set -l current_sinks (pactl list short sinks | grep -i "running" | awk "{ print \$1 }") | |
for sink in $current_sinks | |
switch $argv[1] | |
case mute unmute | |
echo "toggling mute" | |
pactl set-sink-mute $sink toggle | |
case up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun all (seq fn) | |
"Immediately return NIL if FN returns NIL for any item in SEQ." | |
(loop for i in seq | |
always (funcall fn i))) | |
(all '(1 2 3) (lambda (x) (< x 5))) | |
;; => T | |
(all '(1 2) (lambda (x) (= x 1))) | |
;; => NIL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project name="MyProject" default="dist" basedir="."> | |
<description> | |
simple example build file | |
</description> | |
<!-- set global properties for this build --> | |
<property name="src" location="src"/> | |
<property name="build" location="build"/> | |
<property name="dist" location="dist"/> | |
<target name="init"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/sbcl --script | |
;;; Documentation: | |
;;; Commentary: | |
;;; Code: | |
(defun timer-tick () | |
"Waits for 1 second" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestTestDeps | |
{ | |
@Test(alwaysRun = true) | |
public void testZ() | |
{ | |
System.out.println("z is running"); | |
assertEquals(1, 1); | |
} | |
@Test(dependsOnMethods = "testZ") |
OlderNewer