Skip to content

Instantly share code, notes, and snippets.

with AWS.Status;
with AWS.Response;
package Worker_Echoes.Apple.Captive is
function Service (Request : AWS.Status.Data)
return AWS.Response.Data;
end Worker_Echoes.Apple.Captive;
@yorammi
yorammi / 2repos-sync.sh
Last active January 11, 2024 07:25
Sync 2 remote repositories script - Just define the 3 variables (use export command for that!)
#!/bin/bash
# REPO_NAME=<repo>.git
# ORIGIN_URL=git@<host>:<project>/$REPO_NAME
# REPO1_URL=git@<host>:<project>/$REPO_NAME
rm -rf $REPO_NAME
git clone --bare $ORIGIN_URL
if [ "$?" != "0" ]; then
echo "ERROR: failed clone of $ORIGIN_URL"
@xrstf
xrstf / letsencrypt.md
Last active April 18, 2023 05:01
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

@rarylson
rarylson / automator_new_file.scpt
Last active March 1, 2024 01:03
AppleScript to create a new file in Finder (to be used in Automator)
-- AppleScript to create a new file in Finder
--
-- Use it in Automator, with the following configuration:
-- - Service receives: no input
-- - In: Finder.app
--
-- References:
-- - http://apple.stackexchange.com/a/129702
-- - http://stackoverflow.com/a/6125252/2530295
-- - http://www.russellbeattie.com/blog/fun-with-the-os-x-finder-and-applescript
@vinhnx
vinhnx / fbAppInviteDelegateExample.m
Last active August 11, 2017 09:18
Example on how to determine Facebook app invite completion state
#pragma mark - Facebook App Invite Delegate
- (void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didCompleteWithResults:(NSDictionary *)results
{
NSLog(@"app invite result: %@", results);
BOOL complete = [[results valueForKeyPath:@"didComplete"] boolValue];
NSString *completionGesture = [results valueForKeyPath:@"completionGesture"];
// NOTE: the `cancel` result dictionary will be
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos

@robinwl
robinwl / provision.sh
Last active July 3, 2017 13:33
Vagrant shell provisioner for creating a LAMP-stack
##
# Shell provisioner for LAMP
# Tested on Ubuntu 12.04
##
# Detect environment
source /etc/os-release
# Set non-interactive mode
export DEBIAN_FRONTEND=noninteractive
@jasperkuperus
jasperkuperus / DiscriminatorListener.php
Last active July 7, 2023 17:35
This gist shows you how to define your discriminator maps at child level in doctrine 2. Why? Because your parent class shouldn't be aware of all it's subclasses. Please read my article for more explanation: https://medium.com/@jasperkuperus/defining-discriminator-maps-at-child-level-in-doctrine-2-1cd2ded95ffb
<?php
namespace My\Namespace;
/**
* This Listener listens to the loadClassMetadata event. Upon this event
* it hooks into Doctrine to update discriminator maps. Adding entries
* to the discriminator map at parent level is just not nice. We turn this
* around with this mechanism. In the subclass you will be able to give an
* entry for the discriminator map. In this listener we will retrieve the
* load metadata event to update the parent with a good discriminator map,
@asmerkin
asmerkin / Vagrant.bootstrap.sh
Last active June 13, 2022 12:45
A simple LAMP Vagrantfile and Bootstrap file for Vagrant and ubuntu/trusty64 box. It uses mpm-workers and php5-fpm + some extra tools like grunt, gulp and composer.
#!/usr/bin/env bash
# ---------------------------------------
# Virtual Machine Setup
# ---------------------------------------
# Adding multiverse sources.
cat > /etc/apt/sources.list.d/multiverse.list << EOF
deb http://archive.ubuntu.com/ubuntu trusty multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates multiverse