Skip to content

Instantly share code, notes, and snippets.

View x1ddos's full-sized avatar

alex x1ddos

View GitHub Profile
XXkb.mainwindow.enable: yes
XXkb.mainwindow.appicon: no
XXkb.mainwindow.type: tray
XXkb.mainwindow.in_tray: true
XXkb.mainwindow.border.width: 0
XXkb.mainwindow.border.color: white
XXkb.mainwindow.geometry: 20x16+0+0
XXkb.mainwindow.label.enable: yes
XXkb.mainwindow.label.text.1: us
XXkb.mainwindow.label.text.2: mk
@ebidel
ebidel / polymer-perf-bookmarklet.js
Last active May 1, 2021 15:42
Polymer performance numbers bookmarklet
javascript:(function(){(function printStats(){var loadTimes=window.chrome.loadTimes();firstPaint=loadTimes.firstPaintTime*1000;firstPaintTime=firstPaint-(loadTimes.startLoadTime*1000);console.info('First paint took',firstPaintTime,'ms');console.info('Load took',performance.timing.loadEventStart-performance.timing.navigationStart,'ms');var instances=0;if(parseFloat(Polymer.version)<1){instances=[].slice.call(document.querySelectorAll('html /deep/ *')).filter(function(el){return el.localName.indexOf('-')!=-1||el.getAttribute('is');}).length;}else{instances=Polymer.telemetry.instanceCount;}console.info('Custom element instances:',instances);var reflectCount=0;if(Polymer.telemetry){console.info('=== Properties set to reflectToAttribute ===');Polymer.telemetry.registrations.forEach(function(el){for(var prop in el.properties){if(el.properties[prop].reflectToAttribute){console.log(el.is+'.'+prop);reflectCount++;}}});}else{console.info('=== Properties set to reflect ===');Polymer.elements.forEach(function(el){for(var
@proppy
proppy / README.md
Last active December 6, 2022 09:32
apk2layer

apk2layer

apk2layer flattens an alpine linux package(s) and its dependencies into a standalone tarball.

Usage

apk2layer [-mirror] PKGNAME... > layer.tar
@cdipaolo
cdipaolo / HaversinFormula.go
Created April 15, 2015 01:31
Golang functions to calculate the distance in meters between long,lat points on Earth.
// haversin(θ) function
func hsin(theta float64) float64 {
return math.Pow(math.Sin(theta/2), 2)
}
// Distance function returns the distance (in meters) between two points of
// a given longitude and latitude relatively accurately (using a spherical
// approximation of the Earth) through the Haversin Distance Formula for
// great arc distance on a sphere with accuracy for small distances
//
@proppy
proppy / docker-dev.sh
Last active August 29, 2015 14:06
docker-dev: poor man dev workflow for dockerized apps
#!/bin/bash
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@soellman
soellman / easy-k8s-coreos.md
Last active July 22, 2019 14:10
Easy Kubernetes on CoreOS

Easy Kubernetes Installation on CoreOS

At Timeline Labs, we are continuously looking at new technologies to see what fits our needs. We are especially excited about Kubernetes from Google to manage our services atop Docker and CoreOS.

This process for installing Kubernetes on CoreOS uses Flannel for Kubernetes networking and should be cloud provider agnostic. To deploy the Kubernetes master functionality into the cluster, it uses fleetctl.

Thanks to Kelsey Hightower and his blog posts! They served as a great starting point for this process.

How do I get this running?

Add the cloud config below to your own and bring up your cluster using a CoreOS version with Docker 1.3 (currently v472.0.0 in alpha). During that initial boot, the download-kubernetes and download-flannel units will download binaries from the latest project release and use those.

@xpepper
xpepper / .drone.yml
Last active August 25, 2016 22:28
Setting up drone with docker
image: ruby2.0.0
script:
- cp config/database.example.yml config/database.yml
- bundle install
- psql -c 'create extension hstore;' -U postgres -h 127.0.0.1
- psql -c 'create role exmu with superuser login;' -U postgres -h 127.0.0.1
- psql -c 'create database exmu_test;' -U postgres -h 127.0.0.1
- bundle exec rake db:test:prepare
- bundle exec rspec spec
services:
import sys,os
sys.path.insert(0, os.environ.get('GOOGLE_APPENGINE_SDK_PATH'))
sys.path.insert(0, os.environ.get('GOOGLE_APPENGINE_NDB_PATH'))
import dev_appserver
dev_appserver.fix_sys_path()
from google.appengine.ext import testbed
t = testbed.Testbed()
os.environ['APPLICATION_ID'] = 'foo'
t.activate()
t.init_datastore_v3_stub(use_sqlite=True, datastore_file='100GzipText.sqlite')
@vmihailenco
vmihailenco / httptest.go
Created September 18, 2012 08:45
httptest.go
package httptest
import (
"bytes"
"io"
"net/http"
"appengine"
)
import webapp2
from webapp2_extras import local
_local = local.Local()
# The deferred handler instantiates webapp2.WSGIApplication in the module
# globals, so when it is imported it ends resetting app globals.
# To avoid this we duplicate the globals part of the WSGIApplication here,
# knowing that only we will instantiate it.