Skip to content

Instantly share code, notes, and snippets.

View D-32's full-sized avatar
:shipit:
Shipping stuff

Dylan Marriott D-32

:shipit:
Shipping stuff
View GitHub Profile
@dduvnjak
dduvnjak / add_cloudflare_ips.sh
Last active March 7, 2024 15:18
Add CloudFlare IP addresses to an EC2 Security Group using awscli
# first we download the list of IP ranges from CloudFlare
wget https://www.cloudflare.com/ips-v4
# set the security group ID
SG_ID="sg-00000000000000"
# iterate over the IP ranges in the downloaded file
# and allow access to ports 80 and 443
while read p
do
@AfonsoTsukamoto
AfonsoTsukamoto / String+StripHTML.swift
Created March 29, 2015 23:15
A swift string extension to add strip html method to native string
//
// String+StripHtml.swift
import Foundation
class StringStripHTMLParserDelegate: NSObject, NSXMLParserDelegate{
var strings : [String] = []
func parser(parser: NSXMLParser!, foundCharacters string: String!) {
self.strings.append(string)