Skip to content

Instantly share code, notes, and snippets.

Python Basics

Importing Modules

a.py

def func1(x):
  return x + 5

TypeScript Basics

TypeScript is a superset of JavaScript. TypeScript uses transpilation to transpiles the TypeScript into vanilla JavaScript. TypeScript gives you build time checking to avoid runtime errors by enforcing static typing.

Feature Enabled by using typescripts

  • Static Typing
  • Interfaces
  • Class Properties
  • Public/Private Accessiblity levels
@jonepl
jonepl / JavaScriptBasic.md
Last active December 13, 2020 23:05
JavaScript Basics

JavaScript Basics

Block Scope

Block scope - Generally speaking, whenever you see {curly brackets}, it is a block

{
    // Block Scope
}
@jonepl
jonepl / README-Template.md
Created December 23, 2019 13:00 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@jonepl
jonepl / BasicLogger.py
Last active March 11, 2024 17:08
Python Logging Cheat Sheet
'''
File: BasicLogger.py
Description: Logging cheat sheet.. You can find the documentation at
https://docs.python.org/3/library/logging.html.
'''
import logging
import SpecificLogger
# DEBUG: Detailed information, typically of interest only when diagnosing problems.
@jonepl
jonepl / Inheritance.py
Created March 20, 2019 03:05
Simple snippet of Python Inheritance
class Shape(object) :
def __init__(self) :
self.dummyVar = 9
def area(self) :
raise NotImplementedError("You must implement area method in the {0} sub class.".format(self.__class__.__name__))
def perimeter(self) :
raise NotImplementedError("You must implement area method in the {0} sub class".format(self.__class__.__name__))
@jonepl
jonepl / concat.c
Last active October 26, 2016 22:20
Easy concatenation and writing to a file in C
#include <lib.h> // provides _syscall and message
#include <unistd.h> // provides function prototype
#include <stdio.h> // printf
int main() {
int processID = 10;
long timestamp = 123456789;
char fromState[20] = "RDY";
char toState[20] = "RUN";
@jonepl
jonepl / Driver.java
Last active April 14, 2019 21:11
Memento Design Pattern
package learning.dp.memento;
public class Driver {
public static void main (String [] args) {
Orginator o1 = new Orginator();
o1.setName("Purnell Jones");
o1.setHp(16.197);
o1.setSpecialPhrase("Naw Bruh!");