Skip to content

Instantly share code, notes, and snippets.

View kowsheek's full-sized avatar
🚀
Launching

Kowsheek kowsheek

🚀
Launching
View GitHub Profile
@kowsheek
kowsheek / gist:df72986d32847462e102682a7063d9e0
Created July 18, 2019 15:12 — forked from bessarabov/gist:674ea13c77fc8128f24b5e3f53b7f094
One-liner to generate data shown in post 'At what time of day does famous programmers work?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'

Background

  1. Need for persistence
  2. Persistence in the real world
  3. Persistence in computers
    • In memory
    • Text/JSON/binary files
    • Databases
  4. Types of databases

MongoDB

@kowsheek
kowsheek / outline.md
Created March 30, 2018 17:33
W3D5 outline.md

SCSS & Responsive design

Introduction

  1. What is a preprocessor?
  2. SCSS features:
    • variables
    • nesting
    • partials and import
    • mixins
  • extend
@kowsheek
kowsheek / W2D2 breakout outline.md
Created February 20, 2018 20:07
W2D2 breakout
@kowsheek
kowsheek / demo.html
Created December 12, 2017 22:39
W3D2 breakout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<section id="container">
<button name="dog">Add Dog</button>
@kowsheek
kowsheek / W1D5 outline.md
Last active January 25, 2021 07:58
W1D5

Background

  1. Objects: collection of key-value pairs, where keys are unique
  2. Functions: they're contracts, they take in inputs, they usually output some value
  3. Modules: collection of objects and functions that is "exported" and can be "imported"
  4. Packages: description of one or more modules that are available to a developer

Modules

  1. Modules are not special
  2. module.exports
  3. Importing modules
@kowsheek
kowsheek / W4D5 outline.md
Last active November 24, 2017 16:24
W4D5 notes

Background

  • Authentication

    • Email & password security
    • Cookies
    • Tokens (JWT)
  • Authorization

    • Roles
    • Permissions
@kowsheek
kowsheek / knexfile.js
Last active April 7, 2020 11:52
W4D2 breakout notes
const knexConfig = require('./knexfile');
const knex = require('knex')(knexConfig['development']);
const User = require('./user')(knex);
User.find(1).then(function (user) {
console.log(user);
});

Warmup

  • Concepts as experiments
  • CSS is tough
    • Browsers support
    • Focus on using Chrome only
    • Chrome DevTools = best friend
  • SASS/SCSS covered later in the week
  • Bootstrap is to be experimented with
  • Box-model
    • Not perfect but powerful

Recap

Running code

node sample.js 

Variables

var x = 10