Skip to content

Instantly share code, notes, and snippets.

@bryan-mwas
bryan-mwas / async_solution_csbin.js
Created June 1, 2020 20:05
solution to csbin async exercise
/* CHALLENGE 1 */
function sayHowdy() {
console.log('Howdy');
}
function testMe() {
setTimeout(sayHowdy, 0);
console.log('Partnah');
}
@bryan-mwas
bryan-mwas / closures.js
Last active May 22, 2020 11:15
my solution to closure questions @ http://csbin.io/closures
// Type JavaScript here and click "Run Code" or press Ctrl + s
console.log('Hello, world!');
// CHALLENGE 1
function createFunction() {
return function returned() {
console.log('Hello');
}
}
@bryan-mwas
bryan-mwas / to-date.sql
Last active February 28, 2020 06:03
Week and Quarter
-- returns week to date records
select * from tbl_users where
extract(week from created_at) = extract(week from current_date)
and extract(year from created_at) = extract(year from current_date)
-- returns quarter to date records
select * from tbl_users where
extract(quarter from created_at) = extract(quarter from current_date)
and extract(year from created_at) = extract(year from current_date)
@bryan-mwas
bryan-mwas / mtd.sql
Created February 26, 2020 16:10
Query
select * from tbl_users
where extract(month from created_at) = extract(month from current_date)
and extract(year from created_at) = extract(year from current_date);
@bryan-mwas
bryan-mwas / users.csv
Last active February 29, 2020 02:55
Sample Users
id name age gender created_at
1 Homer S 23 Male 2019-03-20
2 Brian M 23 Male 2020-02-05
3 Mr P 34 Male 2020-01-01
4 Sarah D 59 Female 2019-06-13
5 Taylor S 35 Female 2020-02-19
6 Terry Perry 29 Female 2020-02-26
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.ingredients {
color: red
}