Skip to content

Instantly share code, notes, and snippets.

@jdanbrown
jdanbrown / CoreData+Extensions.swift
Created June 5, 2022 04:05 — forked from flaviodsilverio/CoreData+Extensions
Useful Extensions for NSManagedObject + NSManagedObjectContext
import CoreData
extension NSManagedObject {
class var entityName: String! {
get {
return self.entity().managedObjectClassName.components(separatedBy: ["."]).last!
}
}
# Sorted copy of https://gist.github.com/skfarhat/4e88ef386c93b9dceb98121d9457edbf
--------------------------------------------
Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:33:47.663Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
#!/bin/bash -eu
#
# this script will attempt to detect any ephemeral drives on an EC2 node and create a RAID-0 stripe
# mounted at /mnt. It should be run early on the first boot of the system.
#
# Beware, This script is NOT fully idempotent.
METADATA_URL_BASE="http://169.254.169.254/latest"
DEBIAN_FRONTEND=noninteractive apt-get -y install mdadm curl
#!/bin/bash
#
# this script will attempt to detect any ephemeral drives on an EC2 node and create a RAID-0 stripe
# mounted at /mnt. It should be run early on the first boot of the system.
#
# Beware, This script is NOT fully idempotent.
#
METADATA_URL_BASE="http://169.254.169.254/latest"
require 'rubygems'
require 'sinatra'
require 'json'
class GitHubUpdater
def self.update?(json)
(JSON.parse(json)["ref"] == "refs/heads/master")
end
Welcome to Scala version 2.10.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import shapeless._
import shapeless._
scala> import syntax.tuple._
import syntax.tuple._
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.util.Set;
import javax.management.MBeanServer;
import javax.management.ObjectName;
/**
* Print the Collector used in the program.
* @author khotyn
@jdanbrown
jdanbrown / boto-fab.py
Created September 25, 2012 20:40 — forked from marthakelly/boto-fab
Creating EC2 instance with Boto and Fabric
from fabric.api import *
from fabric.colors import green as _green, yellow as _yellow
import boto
import boto.ec2
from config import *
import time
def create_server():
"""
Creates EC2 Instance