Skip to content

Instantly share code, notes, and snippets.

{
"AWSTemplateFormatVersion" : "2010-09-09",
"Resources" : {
"GithubServiceTopic" : {
"Type" : "AWS::SNS::Topic",
"Properties" : {
"DisplayName" : "Topic for Github pull request integration",
"Subscription" : [
{
@jconstance-amplify
jconstance-amplify / Install_selenium.sh
Last active June 20, 2022 23:20
SeleniumConf 2017 Amplify Code Snippets
install_selenium_server_standalone() {
local desired_version=${1:-latest}
# Create our shell user
init_shell_user "selenium" "*"
local selenium_download_site="http://selenium-release.storage.googleapis.com"
local selenium_releases=$(curl --silent --show-error "$selenium_download_site" | grep --only-matching --perl-regexp '[0-9\.-\w]+?/selenium-server-standalone.*?\.jar' | sort --reverse)
if [ "$desired_version" == "latest" ]; then
@honzajavorek
honzajavorek / rant.md
Last active October 19, 2016 19:46
Testování v Pythonu a v JS

Testování v Pythonu a v JS

Hodně lidí v Pythonu používá unittest, což je modul ze standardní knihovny, který lidem umožňuje rychle vytáhnout nějaký ten XUnit způsob psaní testů plný class TestNěco, self.assertTamto() a setUp/tearDown tohleto. Když je testů víc, běžně si k tomu vytáhnou nějaký namakanější test runner, třeba nose. Test runner je něco, co umí inteligentně spouštět testy - např. jen ty, které od posledně selhaly, ale těch užitečných funkcí je tam víc. Protože nose testy spouští, umožňuje vyběhnout z XUnit stylu a nabízí spoustu dalších triků, které ale nikdo nepoužívá, protože o nich neví. V zásadě ale

@monkbroc
monkbroc / Zend_Gdata_HttpClient.php
Created May 28, 2015 17:10
Zend 1 Gdata OAuthClient
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
#!/bin/bash
# pdfScale.sh
#
# Scale PDF to specified percentage of original size.
# Ref: http://ma.juii.net/blog/scale-page-content-of-pdf-files.
echo "This script doesn't handle files with spaces in them."
SCALE=0.95 # scaling factor (0.95 = 95%, e.g.)
anonymous
anonymous / log
Created December 3, 2014 09:15
log
#
##
# logging platform/build
##
#
9cc93738aeb5723e8f9d502e7ac6210c6f6d4073 "LRX22C"
ff8b5b19bed47660bcc6319a73b5b78d1e6dacda "LRX22B"
ced3fdcfa3d576fc42a6a8ad2ff0114af5643255 "LRX21Z"
205c1f8aa4429f742e768199c84ab5f4877b51ab "LRX21Y"
4eab14a6ac5d9deafef778c7bf65f72e130cb2b3 "LRX21X"
@Thrilleratplay
Thrilleratplay / arch-linux-install.md
Last active November 8, 2024 00:06 — forked from mattiaslundberg/arch-linux-install
Installing Arch Linux on an LUKS Encrpyted root and booting from UEFI
@mattiaslundberg
mattiaslundberg / arch-linux-install
Last active December 17, 2025 21:09
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@jaredhirsch
jaredhirsch / gist:4971859
Created February 17, 2013 15:19
all about ETags

ETags: a pretty sweet feature of HTTP 1.1

HTTP caching review

HTTP provides two ways for servers to control client-side caching of page components:

  • freshness may be based on a date or a token whose meaning is app-specific
  • whether or not the client needs to confirm the cached version is up-to-date with the server

This breaks down as follows:

  • Cache locally and don't check before using.
@jaredhirsch
jaredhirsch / gist:4963424
Last active March 19, 2021 08:54
ETags & If-None-Match headers: a dialogue

ETags & If-None-Match headers: a dialogue

1st request.

browser: can haz foo?

GET /foo HTTP/1.1

1st response.