x => x + 1 // similar to function(x) {return x + 1;}
(x, y) => x + y // similar to function(x, y) {return x + y;}
x => {return x + 1}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Ben Kremer's Chat App</title> | |
<meta charset="utf-8"> | |
<script src="http://chatbuilder.hackreactor.com/ChatBuilder.js"></script> | |
</head> | |
<body> | |
<script> | |
delete Chat.display; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /* | |
# * Given two numbers, find all factors of each. | |
# * Return all of their common factors sorted from highest to lowest. | |
# * | |
# * Example 1: | |
# * Find all the common factors of 12 and 18. | |
# * Factors of 12 are 12, 6, 4, 3, 2, 1 | |
# * Factors of 18 are 18, 9, 6, 3, 2, 1 | |
# * The common factors of 12 and 18 are 6, 3, 2, 1 | |
# * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using the Python language, have the function IntersectingLines(strArr) | |
# take strArr which will be an array of 4 coordinates in the form: (x,y). | |
# Your program should take these points where the first 2 form a line and | |
# the last 2 form a line, and determine whether the lines intersect, and if | |
# they do, at what point. | |
# For example: if strArr is ["(3,0)","(1,4)","(0,-3)","(2,3)"], then the line | |
# created by (3,0) and (1,4) and the line created by (0,-3) (2,3) | |
# intersect at (9/5,12/5). Your output should therefore be the 2 points in | |
# fraction form in the following format: (9/5,12/5). If there is no denominator | |
# for the resulting points, then the output should just be the integers like so: (12,3). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import pytz | |
from random import randint | |
from prism_analytics.models import * | |
tz = pytz.UTC | |
RULE_ID = 16 | |
start = datetime.datetime(2016, 5, 13, 22, tzinfo=tz) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias leetcode='cd ~/Dropbox/\ LEETCODE/ && jupyter notebook' | |
alias lc='leetcode' | |
alias leet='leetcode' | |
alias goopencv='deactivate || : && cd ~/Dropbox/\ CLASSES/LearnOpenCV_2021/ && source .venv/bin/activate && jupyter notebook' | |
#Energy Solution specific aliases | |
alias activate='source .venv/bin/activate' | |
alias act='activate' | |
alias deact='deactivate' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adrdash () | |
{ | |
networksetup -connectpppoeservice "L2TP VPN"; | |
open smb://username:password@192.168.25.13/Share/; | |
workon adr-dashboard; | |
git status; | |
git diff; | |
read -r -p "Everything good? Continue? [y/N] " response; | |
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then | |
echo 'Continuing\n'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
people = ['alice', 'bob', 'carl', 'dave', 'asdf', 'sdfg', 'sdffg', 'erty', 'ertry'] | |
people = [1,2,3,4,5,6,7,8,9] | |
def make_groups(people): | |
result_groups = [] | |
current_group = [] | |
Read the copy in the accordion sections for some info about how this was made.
A Pen by Ben Kremer on CodePen.
OlderNewer