Skip to content

Instantly share code, notes, and snippets.

View markjnkim's full-sized avatar

Mark Kim markjnkim

View GitHub Profile
@markjnkim
markjnkim / keybase.md
Created January 21, 2022 14:11
keybase proof

Keybase proof

I hereby claim:

  • I am markjnkim on github.
  • I am mark_ybu (https://keybase.io/mark_ybu) on keybase.
  • I have a public key ASCK-Ov7z6rJiXTH860hJlmjWJ-LuBD5fLgixWvtbxW2igo

To claim this, I am signing this object:

{
"extends": ["eslint:recommended", "plugin:react/recommended"],
"plugins": ["html"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
@markjnkim
markjnkim / Readme
Created August 26, 2017 23:48
Basic Gist Workflow
Name of the project: blog
Team members: Mark @trumpocalypse
Project Description: Create a simple blog using Rails
How to install the code locally: open website on Heroku
How to use the app: Enter a title and post
@markjnkim
markjnkim / OOJS
Created August 23, 2017 02:25
OOJS prototypes
################################################################
##################### OOJS Stamps ##################
################################################################
var StampCollection = function(stamps){
this.stamps = stamps
}
StampCollection.prototype.stampNamed = function (stampName) {
return this.stamps.find(function(stamp){
@markjnkim
markjnkim / gist:4b490bc358e0bd3dc3a00b0b64b5b0e6
Last active August 23, 2017 01:24
OOJS Array.prototype.methods
############# Need to make these methods destructive! #######################################
####################### Accessor methods ########################################################
##################################################################################################
These methods do not modify the array and return some representation of the array.
Array.prototype.concat()
## Returns a new array comprised of this array joined with other array(s) and/or value(s).
Array.prototype.includes()
## Determines whether an array contains a certain element, returning true or false as appropriate.
Array.prototype.indexOf()
@markjnkim
markjnkim / Login boiler plate CRUD
Last active September 12, 2017 22:38
Login in boiler plate CRUD Bcrypt
############################################################################
####################### SERVER SIDE CONTROLLER #######################
############################## Routes #################################
############################################################################
post '/potlucks/:id/attendances' do
@attendance = Attendance.new(attendee_id: current_user.id, potluck_id: params[:id],dish: params[:dish])
if @attendance.save
redirect "/potlucks/#{params[:id]}"
else
@error_messages = @attendance.errors.full_messages
@markjnkim
markjnkim / gist:5507e192c2173c7aa52445439c9e1d15
Created August 22, 2017 17:09
CSS Style Sheet for Broccoli Blog - Ema Overflow
.btn-logout {
width: 100%;
padding-right: 0;
padding-left: 0;
text-align: left !important;
color: rgba(255,255,255,.5);
}
.btn-logout:hover {
color: rgba(255,255,255,.75);
@markjnkim
markjnkim / gist:bced878d9fc71e00c822ff54cf241e71
Last active August 22, 2017 17:04
AJAX event listeners - javascript, jquery, and controller partial view paths
################### Ajax Checkpoint ###############################
################### Alyssa Coyotes 2017 Live Code #####################
########################################################################
################### applications.js ###############################
$(document).ready(function() {
/****
- What thing in html to bind and listen for
- console.log() to make sure events are bound properly
######################### Constructor ###############################
###################### Adds behavior with methods ##################
## Acts like a class since initialized objects now inherit behavior ##
User = function(options){
if (!options) options = {}
this.fname = options.fname
this.lname = options.lname
};
@markjnkim
markjnkim / gist:6ee6e174839d63d10d317ba30d3b66d8
Last active August 22, 2017 19:25
User Authentication using BCrypt, Sessions - Controller and Model
################# Mark Siemer's Teacher Code for Crud Checkpoint #############
##################### CONTROLLER ####################################################
#################### SESSIONS #####################################################
# sessions new
get '/login' do
@user = User.new
erb :'sessions/login'
end