Skip to content

Instantly share code, notes, and snippets.

View jansgescheit's full-sized avatar
✌️

Jan jansgescheit

✌️
  • Herodikos GmbH
  • Oldenburg / Bremen - Germany / Earth
  • 17:49 (UTC +01:00)
View GitHub Profile
@smyth64
smyth64 / Kroll
Last active October 27, 2023 06:40
Kubernetes Force Repull of Image
#!/bin/bash
kubectl patch deployment $1 -p '{"spec": {"template": {"spec":{"containers":[{"name": "'$1'", "imagePullPolicy":"Always"}]}}}}'
sleep 15
kubectl rollout restart deployment $1
sleep 15
kubectl patch deployment $1 -p '{"spec": {"template": {"spec":{"containers":[{"name": "'$1'", "imagePullPolicy":"IfNotPresent"}]}}}}'
# Getting Started
# 1. sudo nano /usr/local/bin/kroll
# 2. paste the code
@jansgescheit
jansgescheit / iphonex-safe-area-dev-tool-helper.js
Last active July 30, 2019 14:43
Ionic 4 - iPhoneX Safe Area Helper
iPhoneX();
['resize','orientationchange'].forEach(function(evt) {
window.addEventListener(evt,iPhoneX,{passive:true});
});
function iPhoneX() {
const portrait = window.innerWidth === 375 && window.innerHeight === 812;
const landscape = window.innerWidth === 812 && window.innerHeight === 375;
if (document.getElementById('iphone_layout')) {
document.body.style.setProperty('--ion-safe-area-left', '');
@matthewerskine
matthewerskine / ResourceDirector.php
Last active September 22, 2019 21:50
Laravel 5.5 Request Director
<?php
namespace App\Http;
use Illuminate\Http\JsonResponse;
use Illuminate\Validation\ValidationException;
use App\Contracts\Http\Resources\ValidatorResourceContract;
class ResourceDirector
{
@alxhub
alxhub / ngsw-doc-draft.md
Last active April 24, 2020 07:26
NGSW Documentation Draft (full)

What are Service Workers (and why might you want one)?

Service Workers are a new technology in modern web browsers. They augment the normal web deployment model and empower applications to deliver reliability and performance on par with natively installed code.

Service Workers have many different capabilities, but the most important is their function as a network proxy. They intercept all outgoing HTTP requests made by the application and can choose how to respond to them. For example, they can query a local cache and deliver a cached response if one is available. Proxying isn't limited to requests made through programmatic APIs (such as fetch), but includes resources referenced in HTML and even the initial request to index.html itself. Service Worker-based caching is thus completely programmable, and doesn't rely on server-specified caching headers.

Unlike the other scripts which make up an application (such as the Angular app bundle), the Service Worker is preserved after the user closes the tab. T

@hishma
hishma / versionInSettings.md
Last active May 31, 2022 07:26
Display iOS app version in settings

To display the current version of an iOS app in the settings

  1. Add an entry like this in Settings.bundle/Root.plist
<key>PreferenceSpecifiers</key>
<array>
  <dict>
    <key>Type</key>
 PSTitleValueSpecifier