Skip to content

Instantly share code, notes, and snippets.

# selenium-webclient does not clean up cookies unless your currently on that page.
module CookieRemover
def self.delete_all(path)
Capybara.current_session.driver.visit(path)
Capybara.reset_sessions!
end
end
After("@external-site") do
CookieRemover.delete_all("http://www.external-site.com")
@alebruck
alebruck / stackscript.sh
Created April 26, 2011 14:13 — forked from cl4rk3/stackscript.sh
Linode Stackscript for Ubuntu 10.10 w/java/groovy/grails
#!/bin/bash
echo deb http://archive.canonical.com/ubuntu maverick partner >> /etc/apt/sources.list
echo deb-src http://archive.canonical.com/ubuntu maverick partner >> /etc/apt/sources.list
echo >> /etc/apt/sources.list
echo deb http://archive.canonical.com/ubuntu maverick-updates partner >> /etc/apt/sources.list
echo deb-src http://archive.canonical.com/ubuntu maverick-updates partner >> /etc/apt/sources.list
echo >> /etc/apt/sources.list
echo deb http://archive.canonical.com/ubuntu maverick-security partner >> /etc/apt/sources.list
echo deb-src http://archive.canonical.com/ubuntu maverick-security partner >> /etc/apt/sources.list

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@eric1234
eric1234 / README.md
Last active December 11, 2015 22:08
S3 - Set permissions public on all files in a bucket using IronWorker.

Purpose

Workers to ensure all objects in a S3 bucket have the 'public-read' canned ACL permission. Designed to work with iron.io's IronWorker product to use it's scalable workers to set the permissions quickly and afforably.

Setup

@jaredwilli
jaredwilli / gist:5469626
Last active February 9, 2024 10:29
HTML5 Canvas Performance and Optimization Tips, Tricks and Coding Best Practices

HTML5 canvas Performance and Optimization Tips, Tricks and Coding Best Practices With canvas being still very new to internet, and no signs of it ever getting old that I can see in the future, there are not too many documented best practices or other really important tips that are a must know for developing with it in any one particular place. Things like this are scattered around and many times on lesser known sites.

There's so many things that people need to know about, and still so much to learn about, so I wanted to share some things to help people who are learning canvas and maybe some who already know it quite well and am hoping to get some feedback from others about what they feel are some best practices or other tips and tricks for working with canvas in HTML5.

I want to start off with one I personally found to be quite a useful yet surprisingly uncommon thing for developers to do. Indent your code Just as you would any other time, in any other language whatever the case may be. It has been a best p

# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@joshlong
joshlong / gist:10964238
Created April 17, 2014 08:23
Register this EmbeddedServletContainerCustomizer @bean in a Spring Boot application to customize the embedded Tomcat instance. In particular, this sets up SSL support for the container. I quite like this because it uses Java 8 lambas to nice effect. No finals, no anonymous inner classes. it just... works.
@Bean
EmbeddedServletContainerCustomizer containerCustomizer(
@Value("${keystore.file}") Resource keystoreFile,
@Value("${keystore.pass}") String keystorePass) throws Exception {
String absoluteKeystoreFile = keystoreFile.getFile().getAbsolutePath();
return (ConfigurableEmbeddedServletContainer container) -> {
if (container instanceof TomcatEmbeddedServletContainerFactory) {
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 28, 2024 15:27
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@staltz
staltz / introrx.md
Last active July 29, 2024 05:55
The introduction to Reactive Programming you've been missing

Quick Tips for Fast Code on the JVM

I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.

This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea