Skip to content

Instantly share code, notes, and snippets.

View jonfriskics's full-sized avatar

Jon Friskics jonfriskics

View GitHub Profile
@jonfriskics
jonfriskics / .gitattributes
Created September 25, 2019 15:08
.gitattributes file to add to Project repos
# From https://help.github.com/en/articles/configuring-git-to-handle-line-endings
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text
# Declare files that will always have CRLF line endings on checkout.
@jonfriskics
jonfriskics / example-mocha-test.js
Last active September 9, 2019 18:54
Example Mocha.js Test
describe("QuizQuestion.js", () => {
it("should have a method named handleClick with the correct parameter @quiz-question-should-have-handle-click", () => {
assert("CONDITION CHECKING IF HANDLECLICK EXISTS", "`QuizQuestion.js` does not contain a method named `handleClick`")
assert("CONDITION CHECKING HANDLECLICK PARAMETER", "`QuizQuestion.js does not have the method named `handleClick` with a parameter named `buttonText`")
})
})
@jonfriskics
jonfriskics / gist:254da17c69b5a9816c60
Created September 23, 2015 02:34
Turn off dotted page break line in Google Docs w/Stylish
.kix-page-compact::before {
border-top: 0 !important;
}
Here's the code I'm using with some logs below.
- (void)viewWillAppear:(BOOL)animated
{
self.manager = [[CMMotionManager alloc] init];
self.manager.deviceMotionUpdateInterval = 0.2;
self.manager.accelerometerUpdateInterval = 0.2;
self.manager.gyroUpdateInterval = 0.2;
self.manager.magnetometerUpdateInterval = 0.2;
[self.manager startDeviceMotionUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMDeviceMotion *motion, NSError *error) {
@jonfriskics
jonfriskics / ComicViewController.swift
Last active August 29, 2015 14:07
Weird initializer behavior
import UIKit
class ComicViewController: UIViewController, UIScrollViewDelegate {
var comicToLoad:NSDictionary
/* This is a custom initializer, but it has to call init(nibName, bundle) or there's a compiler error.
I get that, because init(nibName, bundle) is the designated initializer, but ... */
init(passedInComic: NSDictionary) {
comicToLoad = passedInComic
@jonfriskics
jonfriskics / AppDelegate.swift
Created September 29, 2014 20:11
Is there something special that I have to do when unwrapping objects and getting access to the structs inside of them? This currently works with forced unwrapping, but not with optional binding/chaining. Check out lines 74 through 78 in ViewController.swift
//
// AppDelegate.swift
// Test
//
// Created by Jon Friskics on 9/29/14.
// Copyright (c) 2014 Code School. All rights reserved.
//
import UIKit
@jonfriskics
jonfriskics / functions.playground
Last active August 29, 2015 14:06
Function Argument Unwrap Optional
func myFunc1(name: String!) {
println(name); // playground shows "Jon1" is printed
}
func myFunc2(name: String) {
println(name); // playground shows "Jon2" is printed
}
let str1:String? = "Jon1"; // playground shows str1 is {Some "Jon1"}
let str2:String = "Jon2"; // playground shows str2 is "Jon2"
#import "CSTableViewController.h"
@interface CSTableViewController ()
@end
@implementation CSTableViewController
- (id)initWithStyle:(UITableViewStyle)style
{
@jonfriskics
jonfriskics / gist:4706b45a712c0634815b
Created August 28, 2014 17:20
Stylish GitHub rules
// add these for https://github.com and http://github.com with Stylish (https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en)
// fixes the sidebar repo list truncation on the /dashboard page
.css-truncate-target {
overflow: hidden !important;
white-space: normal !important;
display: block;
max-width: 500px !important;
}
@jonfriskics
jonfriskics / fb-messenger-ios-permissions.md
Last active November 23, 2015 11:30
Facebook Messenger Permissions and iOS

This document is an attempt to debunk all of those "Facebook Messenger is evil!" messages that are cluttering up my news feed. There's several versions of it, but this document is using this one for separating each claim: http://threepercenternation.com/2014/08/facebook-crosses-the-line-with-messenger-app/

Please let me know if I missed something or got something wrong - and if you're interested in working on an Android/Windows Phone version of this then that would be swell too!

Phone Calls and SMS Messages

Call phone numbers and send SMS messages – This means that if Facebook wants to…it can send text messages to your contacts on your behalf.

Developers can create a link that contains a phone number (tel:// URL Scheme), but the user will always be prompted with a "Call" action button - no phone call can automatically be triggered.