Skip to content

Instantly share code, notes, and snippets.

George Mauer togakangaroo

Block or report user

Report or block togakangaroo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View foo.md

Sum elements to next in a list

Question:

I have to create a function that sums of every 2 consecutives elements ina lst. for example ([2,4,3,1,-2]). the output expected [6,7,4,-1]

The basic idea is to take the collection

View foo.md

Table of Contents

The basic idea is to take the collection

View is-it-hoisting.html
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2020-02-06 Thu 17:15 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>&lrm;</title>
<meta name="generator" content="Org mode" />
View *Org HTML Export*.txt
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2020-02-06 Thu 17:15 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>&lrm;</title>
<meta name="generator" content="Org mode" />
View notes.org

.Net Course Outline

History and Glossary

.Net vs Java

Anders Hejlsberg and goals of .Net 1.0

  • Emulate success of Java with something familiar to practictioners
  • Prepare groundwork for fixing Java’s errors
  • Create next-gen system for coding on windows
  • Bring VB6 developers to .Net
  • Bring VB6 developers to the web
  • (Later) Promote component-centeric development and encourage ecosystem
View notes.org

.Net Course Outline

History and Glossary

OpCode Article

.Net vs Java

Anders Hejlsberg and goals of .Net 1.0

  • Emulate success of Java with something familiar to practictioners
  • Prepare groundwork for fixing Java’s errors
  • Create next-gen system for coding on windows
  • Bring VB6 developers to .Net
  • Bring VB6 developers to the web
View timer.specs.js
import { expect } from 'chai'
import { useFakeTimers } from 'sinon'
const createStopWatch = ({ setInterval, clearInterval, Date} = global) => {
const createDisplays = (main, laps = []) => ({main, laps})
let resumeTime
let nextToggle
let currentInterval = null
let prePauseMs = 0
View timer.specs.js
import { expect } from 'chai'
import { useFakeTimers } from 'sinon'
const createStopWatch = () => {
const createDisplays = (main, laps = []) => ({main, laps})
let startTime
const sw = {
displays: createDisplays(null),
toggle: () => {
sw.displays = createDisplays(0)
View timer.specs.js
import { expect } from 'chai'
import { useFakeTimers } from 'sinon'
const createStopWatch = () => {
const createDisplays = (main, laps = []) => ({main, laps})
const sw = {
displays: createDisplays(null),
toggle: () => {
sw.displays = createDisplays(0)
},
View timer.specs.js
describe(`Stopwatch`, () => {
let clock
beforeEach(() => clock = useFakeTimers())
afterEach(() => clock.restore())
describe(`new instance`, () => {
let sw
beforeEach(() => sw = createStopWatch())
it(`shows nothing on main display`, () => expect(sw.displays.main).to.equal(null))
it(`shows no laps`, () => expect(sw.displays.laps).to.deep.equal([]))
You can’t perform that action at this time.