Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Codemode

Adam Dahan adamdahan

💭
Codemode
  • Toronto
View GitHub Profile
@adamdahan
adamdahan / installNodeOnEC2.txt
Created Dec 3, 2018 — forked from mitchallen/installNodeOnEC2.txt
Install node.js and git on an Amazon EC2 instance
View installNodeOnEC2.txt
PREREQUISITES
This assumes that you have already experimented with creating instances under EC2 and know
how to use ssh keys to access an instance. If not, try experimenting with that first and
setup some keys.
This also assume that you have a Security Group with Port 80 available. If not, experiment
with creating one of those as well.
CREATE A NEW INSTANCE
View vue-modal.js
<!-- Setup the trigger -->
<button style="background: #59A7BE; color: white; border: white;" class="button modal-button" data-target="modal-id" @click="launchProfileModal()">View Profile</button>
<!-- Setup the modal -->
<div id="modal-id" class="modal modal-fx-fadeInScale" v-bind:class="{'is-active': paymentsModalIsActive }">
<div class="modal-background"> </div>
<div class="modal-content" style="width: 80%;">
<div class="box">
<div class="content has-text-centered">
View vue_tabs_component.vue
<template>
<div class="container">
<div class="columns" style="margin-top: 40px;">
<div class="column is-12">
<div class="tabs is-toggle">
<ul>
<li :class="[ setting === 'account' ? 'is-active' : '']">
<a @click="setting='account'">
<span class="icon is-small"><i class="fas fa-user" aria-hidden="true"></i></span>
My Profile
@adamdahan
adamdahan / postgres-cheatsheet.md
Last active Aug 14, 2018 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet
View postgres-cheatsheet.md

PSQL

Running SQL files against the database

psql -f thefile.sql targetdatabase

Magic words:

@adamdahan
adamdahan / curl.md
Created Jan 24, 2018 — forked from subfuzion/curl.md
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

View lldb_cheat_sheet.md

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type
View ServiceLocator.swift
import Foundation
protocol ServiceLocator {
func getService<T>(type: T.Type) -> T?
func getService<T>() -> T?
}
extension ServiceLocator {
View ar.rb
# Require any necessary gems
require 'active_record'
require 'pry'
require 'sqlite3'
ActiveRecord::Base.establish_connection(
adapter: 'sqlite3',
database: ':memory:'
)
@adamdahan
adamdahan / 0_reuse_code.js
Created Feb 14, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:f535e97a3aebadc84d33
![Ruby cheatsheet version 0.1](https://github.com/adamdahan/lighthouse-web/blob/master/ruby-cheatsheet-v-0.1/image/ruby-cheatsheet-v-0.1.png)