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
package hw; | |
import java.awt.*; | |
import java.applet.*; | |
public class Oval13 extends Applet { | |
public void init() { | |
setBackground(Color.YELLOW); | |
setForeground(Color.GREEN); | |
} | |
public void paint(Graphics g) { |
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
package hw; | |
import java.awt.*; | |
import java.applet.*; | |
public class Rectangle13 extends Applet{ | |
public void init() | |
{ | |
setBackground(Color.white); | |
setForeground(Color.green); | |
} |
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
@mixin only-for-mobile { | |
@media (max-width: 576px) { | |
@content; | |
} | |
} | |
@mixin mobile-and-above { | |
@media (min-width: 576px) { | |
@content; | |
} |
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
"" Vim commands e: $MYVIMRC | |
" Not compatible with vi | |
set nocompatible " required | |
filetype off " required | |
" ---------- VUNDLE ----------- | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
"call vundle#begin('~/some/path/here') |
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
function chunkArrayInGroups(arr, size) { | |
let newArr = []; | |
let arrLength = arr.length; | |
let lastVal = arrLength % size; | |
let canDo = parseInt(arrLength / size); | |
let sliceStart = 0; | |
let sliceEnd = size; |
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
function sumAll(arr) { | |
let sortedArr = arr.sort((a, b)=>a-b); | |
let sum = sortedArr[0] + sortedArr[1]; | |
for(let i = sortedArr[0]+1; i< sortedArr[1]; i++){ | |
sum+= i; | |
} | |
return sum; |
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
function diffArray(arr1, arr2) { | |
let first = checkOnce(arr1, arr2); | |
let second = checkOnce(arr2, arr1); | |
return first.concat(second); | |
} | |
function checkOnce(arr1, arr2){ | |
let unique = []; |
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
function destroyer(arr, ...rest) { | |
let newArray = [...arr]; | |
rest.forEach(item=>{ | |
while(newArray.includes(item)){ | |
newArray = deleteIfFound(arr, item); | |
} | |
}) |
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
function whatIsInAName(collection, source) { | |
var arr = []; | |
let matchingIndex = []; | |
collection.forEach((obj, index)=>{ | |
let matchBool = matchesSource(obj, source); | |
if(matchBool) | |
matchingIndex.push(index); | |
}); |
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
function spinalCase(str) { | |
let reg = /([A-Z]*[a-z]+)/g; | |
let result = []; | |
str.match(reg).forEach(item=>{ | |
result.push(item.toLowerCase()); | |
}) | |
return result.join("-"); |