Skip to content

Instantly share code, notes, and snippets.

View insaineyesay's full-sized avatar
💭
print(responseMessages[403])

Michael Agee insaineyesay

💭
print(responseMessages[403])
View GitHub Profile
@insaineyesay
insaineyesay / UIView+addDashedBorders.swift
Last active August 11, 2021 18:59
UIView Extension to add a border programmatically to any UIView
extension UIView {
func addDashedBorder() {
let color = UIColor.black.cgColor
let shapeLayer:CAShapeLayer = CAShapeLayer()
let frameSize = self.frame.size
let shapeRect = CGRect(x: 0, y: 0, width: frameSize.width, height: frameSize.height)
shapeLayer.bounds = shapeRect
shapeLayer.position = CGPoint(x: frameSize.width/2, y: frameSize.height/2)
@insaineyesay
insaineyesay / HashTable.swift
Created November 15, 2020 06:06 — forked from davidinga/HashTable.swift
Simple Hash Table implementation in Swift. Includes Linked List, and Node structures. Basic methods.
struct HashTable<Key: Hashable, Value> {
private typealias Element = (key: Key, value: Value)
private typealias List = LinkedList<Element>
private var table: [List]
init(size: Int) {
table = Array<List>()
for _ in 0..<size {
@insaineyesay
insaineyesay / Generic Alert Box configuration
Last active February 14, 2019 02:54
[Alert Action - Dialog Box - Simple Config] #AlertController, #Alerts
var newItemText = UITextField()
let alert = UIAlertController(title: "Add a new Todoey Item", message: "", preferredStyle: .alert)
let action = UIAlertAction(title: "Add Item", style: .default) { (action) in
// what's going to happen when the add button is pressed
let newTodoItem = TodoListItem(context: self.context)
newTodoItem.title = newItemText.text!
newTodoItem.isChecked = false
@insaineyesay
insaineyesay / Generic UITableView Methods
Created February 14, 2019 02:34
[Basic UITableView Delegate Methods] Use this to set up quick UITableViewDelegate methods #UITableView #DelegateMethods
//MARK: - TableView Delegate Methods
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return todoListCategoryArray.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "CategoryCell", for: indexPath)
let item = todoListCategoryArray[indexPath.row]
cell.textLabel?.text = item.name
class MyComponent extends React.Component {
constructor(props) {
// set the default internal state
this.state = {
clicks: 0
};
}
componentDidMount() {
import React from 'react';
import { StyleSheet, Image, Text, View } from 'react-native';
export default class VendorListItem extends React.Component {
constructor(props) {
super(props);
this.content = {
title: this.props.title,
description: this.props.description,
distance: this.props.distance,
'use strict';
angular.module('adminApp')
.controller('MenuController',
function ($rootScope,
$resource,
$scope,
$log,
MenuService,
menuItems,
@insaineyesay
insaineyesay / pin-entry.html
Created February 27, 2016 20:03
pin entry form
<div class="pin-entry--content">
<div class="row" style="text-align: center">
<div class="col col-10 col-offset-15" style="border-bottom: 1px solid black">
{{pinCtrl.passcode.substring(0, 1)}}
</div>
<div class="col col-10 col-offset-10" style="border-bottom: 1px solid black">
{{pinCtrl.passcode.substring(1, 2)}}
</div>
<div class="col col-10 col-offset-10" style="border-bottom: 1px solid black">
{{pinCtrl.passcode.substring(2, 3)}}
@insaineyesay
insaineyesay / auto-focus--directive.js
Created September 15, 2015 13:42
autofocus directive
/*
* @ngdoc directive
* @name autoFocus
* @restrict A
*
* @example
* <form-input-text-area
* data-message="Enter Button Message Here"
* data-ng-class="{isClosed: !formInputTextCtrl.isEdit, isOpen: formInputTextCtrl.isEdit}"
* data-auto-focus="boolean expression">
@insaineyesay
insaineyesay / Brandens String
Last active August 29, 2015 14:14
php string concatenation
echo ('<div class="biowrapper">
<div class="row bio ' . slugify( get_field("doctor_name")) . '">
<div class="medium-4 columns">
<img src=" ' . the_sub_field("image") . ' ">');