Skip to content

Instantly share code, notes, and snippets.

View beatak's full-sized avatar
🍄
Mushroom

Takashi M beatak

🍄
Mushroom
  • San Francisco, CA
View GitHub Profile
'use strict';
const quickSort = function (items, left, right) {
let index;
if (left === undefined) {
left = 0;
}
if (right === undefined) {
right = items.length - 1;
}
Sending build context to Docker daemon 39.42kB
Step 1/24 : FROM debian:stretch-slim
---> 5174edbf8c39
Step 2/24 : RUN set -ex; if ! command -v gpg > /dev/null; then apt-get update; apt-get install -y --no-install-recommends gnupg dirmngr ; rm -rf /var/lib/apt/lists/*; fi
---> Running in 74584963eda6
+ command -v gpg
+ apt-get update
Ign:2 http://deb.debian.org/debian stretch InRelease
Get:3 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:1 http://security-cdn.debian.org/debian-security stretch/updates InRelease [94.3 kB]
@beatak
beatak / find-latest-object-in-bucket.py
Created October 23, 2019 20:14
This requires `boto3` and `pymongo` in pip, also you need to run `aws configure` to be done.
import boto3
import sys
from bson import json_util
import json
from datetime import datetime
def take_last_modified(obj):
return obj.last_modified
def bucket_last_modified(bucket_name: str) -> datetime:
echo "EXISTING_BUNDLER_VERSION=$(find /usr/local/lib/ruby -type f -name bundler-*.gemspec | sed -r "s/^(.+?bundler-)(.+)(\.gemspec)$/\2/")" > _old_bundler.sh
source _old_bundler.sh
@beatak
beatak / home-travis-build.sh
Created May 23, 2019 21:11
travis works like this…?
#!/bin/bash
export TRAVIS_ROOT=/
export TRAVIS_HOME=${HOME}
export TRAVIS_BUILD_DIR=${HOME}/build
export TRAVIS_INTERNAL_RUBY_REGEX=\^ruby-\(2\\.\[0-4\]\\.\[0-9\]\|1\\.9\\.3\)
export TRAVIS_APP_HOST=build.travis-ci.com
export TRAVIS_APT_PROXY=
export TRAVIS_ENABLE_INFRA_DETECTION=true
travis_preamble() {
if [[ -s "${TRAVIS_ROOT}/etc/profile" ]]; then
<?php
if(extension_loaded('newrelic')) {
newrelic_add_custom_tracer('CheckUrl');
newrelic_add_custom_tracer('CheckIp');
newrelic_add_custom_tracer('WptHookValidateTest');
newrelic_add_custom_tracer('GetRedirect');
}
// deal with magic quotes being enabled
if (get_magic_quotes_gpc()) {
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
[settings]
product=WebPagetest
[email protected]
; **************
; UI Integration
; **************
; Comment out the publishTo if you do not want to be able to upload your
; results to the public instance (this is useful for sharing internal tests
[locations]
1=Test_loc
2=Public_Dulles
3=Appurify
default=Test_loc
;
; These are the top-level locations that are listed in the location dropdown
; Each one points to one or more browser configurations
;
#!/bin/bash
set -e
if [ -z "$SERVER_URL" ]; then
echo >&2 'SERVER_URL not set'
exit 1
fi
if [ -z "$LOCATION" ]; then
echo >&2 'LOCATION not set'