Skip to content

Instantly share code, notes, and snippets.

View Tb0's full-sized avatar
💭
QAing

Thibault Béné Tb0

💭
QAing
View GitHub Profile
@Tb0
Tb0 / Tbo_public_key
Created September 26, 2012 15:37
Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyGMlCpBFspZWrkHjgyfgC12RJa4TZ0M0HEtJRvUosb4q5vuKWI8fDJtomejyIA6JPKzkvxVoCG5Kxd525kQver9VJbV95bQQMPWlhxWGQpn/9e7RygeXbZ9vE3hppZ8CU/aXqyaqc0E+a3bh8aUr/5/Gys9KZJUv1Z3JdjNQFrntuoBNOhRIvY4A/TCoGvY07oeRs5yBSrouaX0Wz437FDY2Ji5Yti5/JB9BcIjuDMuVXRAQXMG3y8k6Q0i6q18wnmdtfJqkODDpBhk72LVHjaxdOSA5kKQ+/8AVXW86i0G7R0pESJftX3323od+JG9fnR4khlFH/0ujClsmKvZ9ow== thibault@official.fm
@Tb0
Tb0 / gist:3792732
Created September 27, 2012 07:47
Utopia Mount
function utopia_connect {
echo "Montage du Volume ..."
mkdir /Volumes/Utopia
echo "Connexion en cours ..."
sshfs utopia@ks309872.kimsufi.com:/home/utopia /Volumes/Utopia -oauto_cache,reconnect,volname=Utopia
echo "Connected"
}
@Tb0
Tb0 / wait_for_ajax_method.rb
Created October 18, 2012 13:45
Selenium wait_for_ajax method
# timeout is in seconds
def wait_for_ajax(timeout=x)
time_limit, interval = (Time.now + timeout), 0.5
loop do
break if @driver.execute_script "return jQuery.active == 0"
sleep interval
raise "Wait for AJAX timed out after waiting for #{timeout} seconds" if Time.now > time_limit
end
end
@Tb0
Tb0 / dnd_tracks_into_playlist.rb
Created October 18, 2012 13:50
Drag and drop tracks into playlist
def drag_and_drop_tracks_into_playlist(tracks, playlist)
track_elem = element_by_css('css_path_to_my_track_element')
pl_elem = element_by_css('css_path_to_my_playlist_element')
select_tracks(tracks)
driver.action.click_and_hold(track_elem).move_to(pl_elem, 2, 2).click.perform
wait_for_ajax
end
@Tb0
Tb0 / .gitignore
Created January 10, 2017 14:09
.gitignore
# Folder view configuration files
.DS_Store
Desktop.ini
# Thumbnail cache files
._*
Thumbs.db
# Files that might appear on external disks
.Spotlight-V100
@Tb0
Tb0 / gist:0083f8cc4dff0b0e5748642880205710
Created January 10, 2017 14:10
osx tips and tricks
#!/usr/bin/env bash
# ~/.osx — https://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
[mergetool]
keepBackup = true
[alias]
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
# View the current working tree status using the short format
s = status -s