Skip to content

Instantly share code, notes, and snippets.

@petrucci34
petrucci34 / gist:2f0eb03bec8a33c6e395a12e2f1a47a9
Last active November 25, 2017 06:48
Kotlin Coroutines Implementation Details
// The Kotlin code below is decompiled into the Java code in this file.
/*
fun meaninglessCounter(): Int {
var counter = 0
for (i in 1..10_000_000_000) {
counter += 1
}
return counter
}
@petrucci34
petrucci34 / c#
Created August 2, 2017 00:48
c#-in-a-nutshell
// Check out https://www.microsoft.com/net/tutorials/csharp/getting-started for the comprehensive tutorial.
using System;
// In C#, a namespace is a scope in which developers organize their code,
// and you've been using them throughout the previous lessons.
namespace GettingStartedWithCSharp {
public class Program {
public static void Main() {
@petrucci34
petrucci34 / javascript-oddities.js
Created August 1, 2017 22:24
JavaScript Oddities
// Lack of function signature.
var foo = 'im a number'
function divideByFour(number) {
return number / 4
}
console.log(divideByFour(foo)) //NaN
// Immutability support.