Skip to content

Instantly share code, notes, and snippets.

@twonjosh
twonjosh / Create iOS Icons.jsx
Last active April 25, 2023 08:41 — forked from ma11hew28/Create Icons.jsx
Photoshop Script to Create iOS Icons from a source image
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com
@jamiesanson
jamiesanson / ViewLifecycleBinding.kt
Last active April 18, 2023 11:25
Kotlin Property Delegate for Fragment view lifecycle binding
fun <T> Fragment.viewLifecycle(bindUntilEvent: Lifecycle.Event = Lifecycle.Event.ON_DESTROY): ReadWriteProperty<Fragment, T> =
object: ReadWriteProperty<Fragment, T>, LifecycleObserver {
// A backing property to hold our value
private var binding: T? = null
private var viewLifecycleOwner: LifecycleOwner? = null
init {
// Observe the View Lifecycle of the Fragment
@leogsilva
leogsilva / terraform.py
Created April 25, 2016 14:26
How to discover ip from hosts inside terraform.tfstate. Execute terraform.py --hostfile | more in the directory containing the tfstate file. Code by cisco
#!/usr/bin/env python
#
# Copyright 2015 Cisco Systems, Inc.
#
# 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
#
@liminal
liminal / build.gradle
Created March 29, 2017 12:50 — forked from DariusL/build.gradle
A gradle task to upload android build artifacts to dropbox
import groovyx.net.http.ContentType
import groovyx.net.http.RESTClient
task pushDropbox << {
def outName;
if (System.getenv("GITLAB_CI")) {
outName = "app-debug-${System.getenv("CI_BUILD_REF_NAME")}-SNAPSHOT.apk"
} else {
outName = "app-debug.apk"
}
@DariusL
DariusL / build.gradle
Created December 14, 2015 20:58
A gradle task to upload android build artifacts to dropbox
import groovyx.net.http.ContentType
import groovyx.net.http.RESTClient
task pushDropbox << {
def outName;
if (System.getenv("GITLAB_CI")) {
outName = "app-debug-${System.getenv("CI_BUILD_REF_NAME")}-SNAPSHOT.apk"
} else {
outName = "app-debug.apk"
}
@isaac-jordan
isaac-jordan / premailer.py
Last active February 2, 2019 19:58
An updated version of django-premailer that works with Django 1.9 and Python 3.
# Put in 'templatetags' folder in your Django app.
from __future__ import absolute_import
from django import template
from django.utils.encoding import smart_text
from django.contrib.staticfiles import finders
from django.contrib.staticfiles.storage import staticfiles_storage
from django.conf import settings
from premailer import Premailer