Skip to content

Instantly share code, notes, and snippets.

View steren's full-sized avatar
🏃‍♀️

Steren steren

🏃‍♀️
View GitHub Profile
@steren
steren / balsamiq.svg
Created August 24, 2011 09:41
Balsmiq Mockup style made with Inkscape
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@steren
steren / sterenfr.svg
Created May 6, 2020 20:47
steren.fr as SVG (printed as PDF then converted to SVG)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@steren
steren / package.json
Last active April 2, 2020 04:46
TypeScript to JS
{
"name": "hello-ts",
"version": "1.0.0",
"description": "Hello TS",
"scripts": {
"start": "node server.js",
"gcp-build": "npm run build",
"build": "tsc server.ts"
},
"author": "Steren <steren@google.com>",
@steren
steren / index.html
Created November 18, 2010 02:24
call Wikipedia API using jQuery and parse result
<div id="insertTest"></div>
<script>
var wikipediaHTMLResult = function(data) {
var readData = $('<div>' + data.parse.text.* + '</div>');
// handle redirects
var redirect = readData.find('li:contains("REDIRECT") a').text();
if(redirect != '') {
callWikipediaAPI(redirect);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@steren
steren / cloudbuild.yaml
Created August 10, 2019 00:21
Use Cloud Build for arbitrary container execution (in this case, run ffmpeg)
steps:
- name: 'jrottenberg/ffmpeg'
args: ['-i', 'input.mp4', 'output.avi']
artifacts:
objects:
location: 'gs://steren-test-oneshot/'
paths: ['output.avi']
@steren
steren / loadtest.sh
Last active March 31, 2019 02:37
Send load to URL
# Read docs at https://artillery.io/docs/cli-reference/#quick
npx artillery quick --rate 1 --duration 20 https://myapp.dev
@steren
steren / Dockerfile
Last active September 24, 2018 05:14
Function to generate traffic for a minute on a given URL
FROM node:8
WORKDIR /usr/src/app
COPY package*.json ./
ENV NODE_ENV=production
RUN npm install --production
COPY . .
CMD [ "npm", "start" ]
@steren
steren / gist:dea86dd2352445f926e4d926db709469
Created July 4, 2018 00:12
Headless Chrome Dockerfile
FROM node:8
# Install utilities
RUN apt-get update --fix-missing && apt-get -y upgrade
# Install latest chrome dev package.
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable --no-install-recommends \
@steren
steren / bunyan-trace.js
Last active June 16, 2018 06:55
Use both Stackdriver Trace and Logging modules for automated trace collection in logs to enable logs correlation
require('@google-cloud/trace-agent').start();
const express = require('express');
const app = express();
const bunyan = require('bunyan');
const {LoggingBunyan} = require('@google-cloud/logging-bunyan');
const loggingBunyan = new LoggingBunyan();