Skip to content

Instantly share code, notes, and snippets.

View coreyd303's full-sized avatar
🐲

Corey Davis coreyd303

🐲
  • Remote
View GitHub Profile
@coreyd303
coreyd303 / nudge.py
Last active March 2, 2024 03:49
Debugging with lldb and xCode
""" File: nudge.py
An lldb Python script to add a nudge command.
Add to ~/.lldbinit:
command script import ~/path/to/nudge.py
Usage:
(lldb) nudge x-offset y-offset [view]
@coreyd303
coreyd303 / NLP_snippets.swift
Created July 6, 2017 17:08
Natural language processing with swift
//Access to the new NSLinguisticTagger APIs are provided as a public enum as:
public enum NSLinguisticTagger: Int {
case word
case sentence
case paragraph
case document
}
//To see what units and schemes are available use a class level function:
@coreyd303
coreyd303 / corey_davis
Created October 28, 2014 23:24
Corey Davis lightning talk gist
The idea of genius is often based on some unnatural skill or knowledge. But new science on the idea of mylination and deep practice pushes us to rethink this. I will be discussing this idea, and the application of it to programming as associated skills. Looking at specifically code kata, touch typing, and logical thinking. I don't know what else you want in a gist so...thats it.
1. What does it mean for an application to be multi-tenant?
2. What would you want to build an application to be multi-tenant?
3. How do you implement multi-tenancy at the data / database level?
4. How do Active Record scopes help keep tenant data segregated?
5. Why is multi-tenancy dangerous from a security/privacy perspective?
@coreyd303
coreyd303 / storing_state
Last active August 29, 2015 14:05
Storing State in Sessions
1. What's the difference between a cookie and a session?
A cookie is a string of data that is set on response to be stored on client. It works as an encrypted data package used for managing communication.
A session is more like an object that exists on the request
2. What's serialization and how does it come into play with cookies?
Object --> string (Cookies serialize data)
3. Can a cookie be shared by more than one user? How/why?
Yes, if both users are on the same client. (But really shouldn't be)