Skip to content

Instantly share code, notes, and snippets.

@peter-mw
peter-mw / README.md
Created May 20, 2022 21:11 — forked from zealot128/README.md
Gitlab runner with docker by cloud init on Hetzner Cloud

Quick Terraform script to deploy Gitlab runner with docker onto Hetzner Cloud (Hcloud)

  1. Create other terraform stuff
  • tf-backend,
  • creds.auto.tfvars with hcloud_token
  • ssh key: mkdir keys; ssh-keygen -f id_rsa
  1. modify cloudinit.yml:
  • change gitlab url
  • ADD_YOUR_REGISTRY_TOKEN -> Set to the Gitlab Runner Registration Token
  • Add more allowed images/services, if using gitlab registry, like that: registry.myinstance.com/administrators/docker-images/*, change base image etc.
@peter-mw
peter-mw / key.md
Created November 22, 2020 21:03
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@peter-mw
peter-mw / google-fonts-proxy
Created December 21, 2018 10:31 — forked from gaoyifan/google-fonts-proxy
google-fonts-proxy
server {
listen 80;
listen 443;
listen [::]:80;
listen [::]:443;
server_name fonts.lug.ustc.edu.cn;
access_log /var/log/nginx/revproxy_access.log;
error_log /var/log/nginx/revproxy_error.log;
@peter-mw
peter-mw / IsStaticProxy.php
Created March 7, 2017 21:49 — forked from dlundgren/IsStaticProxy.php
Static Proxy trait
<?php
/**
* Simple static proxy trait
*
* Aura DI is used for lazy loading
*
* Set `const PROXY_IDENTIFIER = "SomeClass" in your proxy class, and use this trait.
*
* Call `Some\Proxy\SomeClass::register(new SomeClassInstance)` to have it register the alias.
*
@peter-mw
peter-mw / run_servers.sh
Created July 29, 2016 15:07
Starts selenium server and php built-in webserver to run selenium tests.
#!/bin/bash
# kill 0 sends the signal to all processes in the current process group too.
trap "stty echo;kill 0;echo;exit" SIGINT SIGTERM EXIT
# Selenium server path. codeception, php and jva are expected to be defined in PATH
selenium_jar="/Users/ozan/bin/selenium-server-standalone-2.39.0.jar"
selenium_log="tests/log/selenium.log"
webserver_port=8080
webserver_document_root="public"
@peter-mw
peter-mw / addRowToSpreadsheet.php
Created July 11, 2016 10:45 — forked from thehelvetian/addRowToSpreadsheet.php
Add a new row to a spreadsheet using Google Sheets API v4
<?php
function addRowToSpreadsheet($ary_values = array()) {
// Set up the API
$client = new Google_Client();
$client->setAuthConfigFile(KEYS_PATH.'/client_secret.json'); // Use your own client_secret JSON file
$client->addScope(Google_Service_Sheets::SPREADSHEETS);
$accessToken = 'ACCESS_TOKEN'; // Use your generated access token
$client->setAccessToken($accessToken);
$sheet_service = new Google_Service_Sheets($client);
@peter-mw
peter-mw / crypt.php
Created November 17, 2015 21:33 — forked from leonjza/crypt.php
Laravel Crypt encryptor / decryptor.
<?php
/*
* Quick 'n Dirty Laravel 5.1 decrypter.
*
* Based directly off the source code at:
* https://github.com/laravel/framework/blob/5.1/src/Illuminate/Encryption/Encrypter.php
*
* Have access to an application key from a .env?
* Have some encrypted data you want to decrypt?
* Well: (new Crypt($key))->decrypt($payload); should have you sorted

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

<?php
use Silex\Application;
use Silex\ServiceProviderInterface;
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
use Illuminate\Cache\CacheManager;
class CapsuleServiceProvider implements ServiceProviderInterface
{