Skip to content

Instantly share code, notes, and snippets.

View claraj's full-sized avatar

Clara claraj

  • Minneapolis College
  • Minneapolis, MN
View GitHub Profile
@claraj
claraj / git_submodule_fix.md
Last active April 7, 2024 13:37
Fixing git submodule AKA git repo inside another git repo

Problem, and symptoms:

You experience one or more of these symptoms

  • you have code in a directory but it's not being pushed to GitHub. You just see an empty directory icon
  • you see this message when you add code to your git repository from the command prompt
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
<!-- civicsQuiz-->
<!DOCTYPE html>
<lang=”en”>
<head>
<title> Civics Quiz </title>
<!--for bootstrap-->
<meta charset = “utf-8”>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
title Express and Vue
participantgroup SERVER
participant Vue app files
database Database
participant API Server
participant Express Server
end
@claraj
claraj / map_filter.js
Last active March 17, 2020 17:08
Map, filter, spread operator
// More examples https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d
let cats = ['Hello Kitty', 'Maru', 'Garfield', 'Soymilk', 'Miles', 'Meridith']
// Mapping - creating a new array built from elements of an existing array
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
let uppercaseCats = cats.map( function(cat) {
return cat.toUpperCase()
})
@claraj
claraj / map_filter.js
Created March 17, 2020 16:00
Map, filter, spread operator
let cats = ['Hello Kitty', 'Maru', 'Garfield', 'Soymilk', 'Miles', 'Meridith']
// Mapping - creating a new array built from elements of an existing array
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
let uppercaseCats = cats.map( function(cat) {
return cat.toUpperCase()
})
// Arrow function, full version
@claraj
claraj / map_filter.js
Created March 17, 2020 16:00
Map, filter, spread operator
let cats = ['Hello Kitty', 'Maru', 'Garfield', 'Soymilk', 'Miles', 'Meridith']
// Mapping - creating a new array built from elements of an existing array
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
let uppercaseCats = cats.map( function(cat) {
return cat.toUpperCase()
})
// Arrow function, full version
function fetchingData( done ) {
fetch(`https://api.worldbank.org/v2/country/${countryCode}?format=json`)
.then(res => res.json())
.then(countryData => {
console.log(countryData);
console.log(countryData[1][0]['capitalCity']);
let capCity = countryData[1][0]['capitalCity'];
done(capCity)
})
.catch(err => {
import sqlite3
db = 'example.sqlite'
def execute(sql, *params):
with sqlite3.connect(db) as con:
cur = con.execute(sql, params)
return cur.rowcount
import java.util.List;
/**
* Created by clara on 1/16/20.
*/
public class TicketMasterResponse {
public Embedded _embedded;
@Override
public String toString() {
<img id="uploaded-image">
<input id="image-input" type="file">
<button id="upload">Click to upload</button>
<script>
let img = document.querySelector("#uploaded-image")
let input = document.querySelector("#image-input")
let button = document.querySelector('#upload')