Skip to content

Instantly share code, notes, and snippets.

@mhucka
mhucka / gist:59e785a315d813d14cd0258b89a2fcac
Last active February 2, 2024 22:28
Stop the Adobe Creative Cloud app from auto-launching on login on macOS
#!/bin/bash
# =============================================================================
# @file GitHub gist
# @brief stop Adobe Creative Cloud app from auto-launching on login on macOS
# @author Michael Hucka <mhucka@caltech.edu>
# @created 2021-08-12
# @website https://gist.github.com/mhucka/59e785a315d813d14cd0258b89a2fcac
#
# I find Adobe Creative Cloud absolutely infuriating. It installs auto
# launchers that are not in the user's login app list, and the services are
@diachedelic
diachedelic / deep-link-from-browser.js
Last active May 8, 2024 11:11
Deep link to a native app from a browser, with a fallback
@JohnnyWalkerDigital
JohnnyWalkerDigital / laravel-password-reset.md
Last active August 31, 2021 07:21
Laravel: Fix password reset (User email not sent)

Here's how to overcome this common gotcha: The default password reset system not working out of the box with Laravel 5.x (as you're not sent the user's password), without having to alter altering vendor/core. Here's how to make it work as you'd expect it to without changing any vendor files.

1. Create own notification

Firstly create a new notification for your app:

php artisan make:notification ResetPassword

Then open the newly created file: app\Notifications\ResetPassword.php and make the following changes:

@BenSampo
BenSampo / deploy.sh
Last active April 30, 2024 03:41
Laravel deploy script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH
@paulredmond
paulredmond / ValidateMailgunWebhook.php
Created April 24, 2017 21:55
Laravel Middleware to Validate a signed Mailgun webhook
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Response;
/**
* Validate Mailgun Webhooks
* @see https://documentation.mailgun.com/user_manual.html#securing-webhooks
@pdtyreus
pdtyreus / SlackPostMessageWithAttachments.js
Created September 8, 2016 22:15
Slack chat.postMessage with attachments
var http = require("https");
var querystring = require('querystring');
//2 attachments as JavaScript Objects
var attachments = [{
fallback: "Attachment 1 Fallback",
title: "This is Attachment 1",
text: "Attachment 1 Text",
color: "#3964db"
}, {
@daronco
daronco / letsencrypt-webroot-apache.md
Last active February 15, 2024 11:50
Letsencrypt with webroot on Apache

Config Apache with /etc/apache2/conf-available/le.conf:

Alias /.well-known/acme-challenge/ "/var/www/html/.well-known/acme-challenge/"
<Directory "/var/www/html/">
    AllowOverride None
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>
@tomredman
tomredman / explicit.java
Last active April 13, 2016 13:56
Code Principle Example: "Explicit is better than Implicit"
/**
* You've probably heard it before, "explicit is better than implicit". Here's a simple
* example of that principle in action.
*
* In this example, our app has only two Fragments that can be visible at any given
* moment: CreateFragment and TrendingFragment. Both examples achieve the same result
* when everything is working as expected, however...
*
* In the explicit example, a final else{} branch would indiciate something's not
* quite right with our code somewhere since we know there are only two possible
@tomredman
tomredman / ColorFadeTransform.java
Last active April 13, 2016 13:23
ColorFadeTransform for Picasso
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Shader;
import android.support.annotation.ColorInt;
import com.squareup.picasso.Transformation;
@nickbutcher
nickbutcher / 1 search_bar.xml
Last active March 26, 2022 10:03
Demonstrating morphing a search icon into a search field. To do this we use an AnimatedVectorDrawable (https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html) made up of two paths. The first is the search icon (as a single line) the second is the horizontal bar. We then animate the 'trimPathStart' property …
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The Android Open Source Project
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