Skip to content

Instantly share code, notes, and snippets.

image: python:2.7
before_script:
- echo "deb http://packages.cloud.google.com/apt cloud-sdk-jessie main" | tee /etc/apt/sources.list.d/google-cloud-sdk.list
- curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
- apt-get update && apt-get install google-cloud-sdk
after_script:
- rm /tmp/$CI_PIPELINE_ID.json
@helfer
helfer / apolloHAPI.js
Last active March 7, 2017 12:44
Using Apollo Server with HAPI
import hapi from 'hapi';
import graphql from 'graphql';
import { ApolloHAPI } from 'apollo-server';
const myGraphQLSchema = new graphql.GraphQLSchema({
// define your schema in GraphQL.js syntax here ...
});
const server = new hapi.Server();
@sosedoff
sosedoff / 1_simple.go
Created July 16, 2016 18:45
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@arikfr
arikfr / README.md
Last active August 26, 2024 19:27
Redash Query Export Tool

Setup

$ pip install click requests

Usage

$ python query_export.py --redash-url "https://app.redash.io/" --api-key ""
@ericuldall
ericuldall / bq_audit.js
Created December 17, 2015 19:09 — forked from anonymous/bq_audit.js
An easy way to audit big query costs in node
var audit = { //configure audit settings
export: {
project_id: 'PROJECT ID TO AUDIT QUERIES FROM'
},
import: {
project_id: 'PROJECT ID TO STORE AUDIT DATA IN',
dataset_id: 'DATASET ID TO STORE AUDIT DATA IN',
table_id: 'TABLE ID TO STORE AUDIT DATA IN'
}
};
@arikfr
arikfr / fabfile.py
Last active February 19, 2021 10:03
re:dash fabfile
#!/usr/bin/env python
# vim: ts=4:sw=4:expandtab:autoindent:
import os
import sys
import requests
import filecmp
from fabric.context_managers import hide, settings, prefix
from fabric.api import sudo, task, run, cd, env
from fabric.contrib.console import confirm
from fabric.colors import green
@timlinux
timlinux / coreos-docker.md
Last active January 27, 2024 13:02
Setting up a hetzner machine with coreos

This gist describes how to set up a new machine running coreos.

Create an ssh key

ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa_kartoza99

Get the public key:

@silentsokolov
silentsokolov / get_youtube_id.py
Last active November 9, 2023 22:16
Python: get youtube id
# Get youtube id
#http://youtu.be/5Y6HSHwhVlY
#http://www.youtube.com/embed/5Y6HSHwhVlY?rel=0
#http://www.youtube.com/watch?v=ZFqlHhCNBOI
regex = re.compile(r'(https?://)?(www\.)?(youtube|youtu|youtube-nocookie)\.(com|be)/(watch\?v=|embed/|v/|.+\?v=)?(?P<id>[A-Za-z0-9\-=_]{11})')
match = regex.match(self.youtube_url)
@hadrien
hadrien / doc.rst
Last active September 16, 2016 17:58
Pyramid ACLs + traversal = NICE
@jgoux
jgoux / app.js
Created April 15, 2014 14:53
Ionic / AngularJS service wrapper for Web SQL API / SQLite-Cordova-Plugin
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});