Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.
@exera
exera / rem-calibrate.css
Last active September 8, 2015 11:13 — forked from brianblakely/rem-calibrate.css
Simulate vw with rems
/* Android stock browser won't let you set font-size smaller than 8px unless you apply this. */
:root {
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
-ms-text-size-adjust: none;
-o-text-size-adjust: none;
text-size-adjust: none;
}
@exera
exera / introrx.md
Created February 25, 2016 06:52 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
(function () {
var dateTimeController = function ($scope, $rootScope) {
$scope.vm = {
message: "Bootstrap DateTimePicker Directive",
dateTime: {}
};
$scope.$watch('change', function(){
console.log($scope.vm.dateTime);
});
#!/bin/bash
set -e
# Apache gets grumpy about PID files pre-existing
rm -f /var/run/apache2/apache2.pid
exec apache2 -DFOREGROUND
@exera
exera / MenuViewController.swift
Created May 5, 2017 06:30 — forked from DennisDreissen/MenuViewController.swift
SWRevealController Snippet
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
self.revealViewController().view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
self.revealViewController().frontViewController.revealViewController().tapGestureRecognizer()
self.revealViewController().frontViewController.view.userInteractionEnabled = false
}
override func viewWillDisappear(animated: Bool) {
super.viewWillAppear(animated)
@exera
exera / loadFont.swift
Created July 24, 2017 07:47 — forked from zwang/loadFont.swift
Dynamically load font from a font file in swift in IOS
static func loadFont(fontName: String, baseFolderPath: String) -> Bool {
let basePath = baseFolderPath as NSString
let fontFilePath = basePath.stringByAppendingPathComponent(fontName)
let fontUrl = NSURL(fileURLWithPath: fontFilePath)
if let inData = NSData(contentsOfURL: fontUrl) {
var error: Unmanaged<CFError>?
let cfdata = CFDataCreate(nil, UnsafePointer<UInt8>(inData.bytes), inData.length)
if let provider = CGDataProviderCreateWithCFData(cfdata) {
if let font = CGFontCreateWithDataProvider(provider) {
if (!CTFontManagerRegisterGraphicsFont(font, &error)) {
@exera
exera / Xcode8AutomaticSigning.md
Created August 12, 2017 13:57 — forked from KevinKelchen/Xcode8AutomaticSigning.md
iOS Xcode 8 Automatic Signing Identity and Provisioning Setup

iOS Xcode 8 Automatic Signing Identity and Provisioning Setup

These are the steps our team used to get Xcode 8's Automatic Signing working for our iOS app. We felt it would be valuable to share this with the community (particularly given the effort it required us to get it working). While our research yielded some valuable information from others, it wasn't as simple as it sounded. We figured that we're not alone. 😄

For reference, these were some of the resources that proved valuable to us:

These steps presume that you have some understanding of iOS code signing and familiarity w

@exera
exera / youtubeID.js
Created August 24, 2017 09:37 — forked from takien/youtubeID.js
Get YouTube ID from various YouTube URL using JavaScript
/**
* Get YouTube ID from various YouTube URL
* @author: takien
* @url: http://takien.com
* For PHP YouTube parser, go here http://takien.com/864
*/
function YouTubeGetID(url){
var ID = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
@exera
exera / mysql-docker.sh
Created January 17, 2018 08:06 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE