Skip to content

Instantly share code, notes, and snippets.

Jordan Ivanov DaniGithub

Block or report user

Report or block DaniGithub

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
@DaniGithub
DaniGithub / resize.c
Last active Jun 9, 2018
CS50 BMP Resize
View resize.c
#include <stdio.h>
#include <stdlib.h>
#include "bmp.h"
int main(int argc, char *argv[])
{
// ensure proper usage
if (argc != 4)
{
@DaniGithub
DaniGithub / functions.js
Created Apr 17, 2016
JavaScript Functions
View functions.js
function foo() {
return 42;
}
foo.bar = "hello world";
typeof foo; // "function"
typeof foo(); // "number"
typeof foo.bar; // "string"
@DaniGithub
DaniGithub / objects.js
Created Apr 17, 2016
Objects in JavaScript
View objects.js
var obj = {
a: "hello world",
b: 42
};
var b = "a";
obj[b]; // "hello world"
obj["b"]; // 42
@DaniGithub
DaniGithub / data-types.js
Created Apr 17, 2016
JavaScript data types (typed values)
View data-types.js
var a;
typeof a; // "undefined"
a = "hello world";
typeof a; // "string"
a = 42;
typeof a; // "number"
a = true;
View YDKJS-Practice-byAuthor.js
const SPENDING_THRESHOLD = 200;
const TAX_RATE = 0.08;
const PHONE_PRICE = 99.99;
const ACCESSORY_PRICE = 9.99;
var bank_balance = 303.91;
var amount = 0;
function calculateTax(amount) {
return amount * TAX_RATE;
View New HTML Document Template.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
View BonfireSmallestCommonMultiple-betterSolution.js
function smallestCommons(arr) {
// Sort array from greater to lowest
// This line of code was from Adam Doyle (http://github.com/Adoyle2014)
arr.sort(function(a, b) {
return b - a;
});
// Create new array and add all values from greater to smaller from the original array.
var newArr = [];
for (var i = arr[0]; i >= arr[1]; i--) {
You can’t perform that action at this time.