Skip to content

Instantly share code, notes, and snippets.

View tiaanduplessis's full-sized avatar
🤷‍♂️
Ain't maintaining shit atm. Use at own risk.

Tiaan tiaanduplessis

🤷‍♂️
Ain't maintaining shit atm. Use at own risk.
  • Cape Town, South Africa
  • 18:25 (UTC +02:00)
View GitHub Profile
@tiaanduplessis
tiaanduplessis / matchesForRegexInText.swift
Created June 17, 2016 12:11
Matches for Regular Expression in text - Swift 2.2
func matchesForRegexInText(regex: String!, text: String!) -> [String] {
let regex = try! NSRegularExpression(pattern: regex, options: [])
let nsString = text as NSString
let results = regex.matchesInString(text, options: [], range: NSMakeRange(0, nsString.length))
return results.map({ nsString.substringWithRange($0.range)})
}
@tiaanduplessis
tiaanduplessis / README.md
Created June 18, 2016 00:16 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@tiaanduplessis
tiaanduplessis / index.html
Created July 2, 2016 09:49
Page Preloader
<!--Add directly after body tag-->
<!-- Preloader -->
<div id="preloader">
<div id="status">&nbsp;</div>
</div>
<!--Below jquery include-->
<!-- Preloader -->
@tiaanduplessis
tiaanduplessis / LAMPInstall.sh
Created July 21, 2016 19:54
LAMP Install Ubuntu 16.04
#!/bin/bash
sudo apt-get update
# Install Apache
sudo apt-get install apache2
# Allow incoming traffic for this profile
sudo ufw allow in "Apache Full"
@tiaanduplessis
tiaanduplessis / Badge.swift
Created August 24, 2016 22:09 — forked from yonat/Badge.swift
Rounded UILabel and UIButton, Badged UIBarButtonItem
//
// Badge.swift
// Extensions for Rounded UILabel and UIButton, Badged UIBarButtonItem.
//
// Usage:
// let label = UILabel(badgeText: "Rounded Label");
// let button = UIButton(type: .System); button.rounded = true
// let barButton = UIBarButtonItem(badge: "42", title: "How Many Roads", target: self, action: "answer")
//
// Created by Yonat Sharon on 06.04.2015.
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
// Run from the dev tools console of any Youtube video
// Accurate as of October 28, 2016. Uses quality + video type for naming now,
// prevents video urls being overwritten.
// ES6 version
const videoUrls = ytplayer.config.args.url_encoded_fmt_stream_map
.split(',')
.map(item => item
.split('&')
.reduce((prev, curr) => (curr = curr.split('='),
@tiaanduplessis
tiaanduplessis / giphy.4.gif
Created May 2, 2019 12:28
Gist for giphy.4.gif. Generated by `crop-github-images-cli`.
Placeholder for giphy.4.gif.
@tiaanduplessis
tiaanduplessis / giphy.1.gif
Created May 2, 2019 12:28
Gist for giphy.1.gif. Generated by `crop-github-images-cli`.
Placeholder for giphy.1.gif.
@tiaanduplessis
tiaanduplessis / giphy.3.gif
Created May 2, 2019 12:28
Gist for giphy.3.gif. Generated by `crop-github-images-cli`.
Placeholder for giphy.3.gif.