Skip to content

Instantly share code, notes, and snippets.

View santiycr's full-sized avatar
💭
Always learning

Santiago Suarez Ordoñez santiycr

💭
Always learning
View GitHub Profile
#!/usr/bin/env python
import os
import time
import subprocess
import tempfile
import zipfile
import urllib
import logging
@santiycr
santiycr / sauce_connect_setup.sh
Last active December 14, 2015 19:49
A small bash script to download and start Sauce Connect as part of a Travis Build.
#!/bin/bash
# Setup and start Sauce Connect for your TravisCI build
# This script requires your .travis.yml to include the following two private env variables:
# SAUCE_USERNAME
# SAUCE_ACCESS_KEY
# Follow the steps at https://saucelabs.com/opensource/travis to set that up.
#
# Curl and run this script as part of your .travis.yml before_script section:
# before_script:
@santiycr
santiycr / gist:4489869
Last active December 10, 2015 20:38
import time declarations, nono!
In [2]: class C(object):
...: def hi(self, k, d=dict()):
...: d[k] = 1
...: print d
...:
In [3]: c = C()
In [4]: c.hi(1)
{1: 1}
@santiycr
santiycr / commit-msg
Created December 18, 2012 15:07
Git commit hook to automatically add your Selenium wiki name to every commit.
#!/bin/bash
# Automatically adds your Selenium wiki name in case it's missing
# Place in selenium/.git/hooks
# chmod +x selenium/.git/hooks/commit-msg
# Append 'export SELENIUM_WIKI_NAME="YourWikiName"' to your bashrc/zshrc
echo "Checking commit message..."
if [ -z "$(grep -e "^$SELENIUM_WIKI_NAME: " $1)" ]; then
echo "Missing Wiki name in commit message, appending"
@santiycr
santiycr / selenium_sauce_tests.py
Created August 13, 2012 18:19
Run multiple browsers on Sauce in parallel using some python magic
#!/usr/bin/env python
# encoding: utf-8
from selenium import webdriver
import unittest
import nose
from nose.plugins.multiprocess import MultiProcess
import new
import json
import httplib
@aemkei
aemkei / LICENSE.txt
Last active April 12, 2024 21:27 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@santiycr
santiycr / saucerest_python_example.py
Created January 20, 2012 01:37
Sauce REST API via Python
import httplib
import base64
try:
import json
except ImportError:
import simplejson as json
config = {"username": "your-sauce-username",
"access-key": "your-sauce-api-key"}
@santiycr
santiycr / TestingUploadSe2Sauce.java
Created December 22, 2011 04:44
Remote File Upload using Selenium 2's FileDetectors
import junit.framework.Assert;
import junit.framework.TestCase;
import org.openqa.selenium.*;
import org.openqa.selenium.remote.*;
import java.net.URL;
import java.util.concurrent.TimeUnit;
public class TestingUploadSe2Sauce extends TestCase {
private RemoteWebDriver driver;
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@santiycr
santiycr / selenium2_test_case.py
Created July 26, 2011 19:32
Reporting pass/fail status automatically in Selenium 2 tests
class Selenium2TestCase(TestCase):
def report_pass_fail(self):
base64string = base64.encodestring('%s:%s' % (config['username'],
config['access-key']))[:-1]
result = json.dumps({'passed': self._exc_info() == (None, None, None)})
connection = httplib.HTTPConnection(self.config['host'])
connection.request('PUT', '/rest/v1/%s/jobs/%s' % (self.config['username'],
self.driver.session_id),
result,