Skip to content

Instantly share code, notes, and snippets.

View BrianARuff's full-sized avatar
:copilot:
Making the world a better place 🤪

Brian Ruff BrianARuff

:copilot:
Making the world a better place 🤪
View GitHub Profile
def delete(self, value):
current_node = self.head
previous_node = None
while current_node:
if current_node.value == value:
previous_node.next = current_node.next
break
previous_node = current_node
current_node = current_node.next
function negCheck (num1, num2) {
return [
(
(num1 < 0 && num2 > 0) ||
(num1 > 0 && num2 < 0)
),
];
}
function divide(x, y) {
string = "I like parentheticals (a lot). Sometimes(when I nest them(my parentheticals) too much (like
this(and this))), it get confusing."
def parentheticals_open_close_position(str)
starting_parentheticals = []
ending_parenthetical = []
str.each_char.with_index do |char, index|
if char == '('
starting_parentheticals << index
end
import React from 'react';
import PropTypes from 'prop-types';
class navHeader extends React.Component {
constructor(props) {
super(props);
this.state = {
isOpen: false,
};
import React from 'react';
import PropTypes from 'prop-types';
class navHeader extends React.Component {
constructor(props) {
super(props);
this.state = {
isOpen: false,
};
import React from 'react';
import FacebookAuth from 'react-facebook-auth';
const authenticate = response => {
const headers = new Headers();
headers.append('Content-Type', 'application/json');
fetch('http://localhost:3000/api/v1/auth/oauth_login', {
method: 'POST',
headers,
body: JSON.stringify({
# frozen_string_literal: true
scope_array = 100.times.map{Random.rand(0...100)}
def binary_search_tree(target, scope, carry_over = 0)
p scope.sort
if scope.length <= 1
target == scope.first ? carry_over : -1
else
half = scope.length / 2
if scope[half] == target
string = "I like parentheticals (a lot). Sometimes(when I nest them(my parentheticals) too much (like
this(and this))), it get confusing."
def parentheticals_open_close_position(str)
starting_parentheticals = []
ending_parenthetical = []
str.each_char.with_index do |char, index|
if char == '('
starting_parentheticals << index
end
# initialize stock_prices_yesterday array
stock_prices_yesterday = [];
# fill it with random values just for theory sake
stock_prices_yesterday << 10.times.map { rand(1000)}
# flatten array so that it is only 1 array and not a multidimensional array
stock_prices_yesterday.flatten!
def get_max_profit(stock_prices_yesterday)
var weaponArray = ['rock', 'paper', 'scissors'];
var playerOne;
var playerTwo;
var playerOneScore = 0;
var playerTwoScore = 0;
while (playerOneScore < 3 && playerTwoScore < 3) {