This file contains hidden or 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
public static void main(String[] args) { | |
HttpURLConnection connection = null; | |
String inputLine; | |
StringBuffer response = new StringBuffer(); | |
try { | |
URL url = new URL("url"); | |
connection = (HttpURLConnection) url.openConnection(); | |
connection.setRequestMethod("GET"); | |
connection.setRequestProperty("Content-Type","application/json"); |
This file contains hidden or 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
<html> | |
<ul> | |
<li>ALFA ROMEO</li> | |
<li>AUDI</li> | |
<li>AUSTIN</li> | |
<li>BMW</li> | |
.. etc etc | |
<li>TOYOTA</li> | |
<li>TRIUMPH</li> | |
<li>VAUXHALL</li> |
This file contains hidden or 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
var heroes = [ | |
{name: “Batman”, franchise: “DC”}, | |
{name: “Ironman”, franchise: “Marvel”}, | |
{name: “Thor”, franchise: “Marvel”}, | |
{name: “Superman”, franchise: “DC”} | |
]; | |
//this text should come from input | |
var query = "marvel"; |
This file contains hidden or 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
xs | |
0 - 576px | |
sm | |
> 576px | |
md | |
> 768px | |
lg | |
> 992px | |
xl | |
> 1200px |
This file contains hidden or 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
//animation like - twitter opt1 | |
.heart { | |
width: 50px; | |
height: 50px; | |
background: url("https://cssanimation.rocks/images/posts/steps/heart.png") no-repeat; | |
background-size: cover; | |
background-position: 0 -7px; | |
cursor: pointer; | |
transition: background-position 1s steps(28); | |
transition-duration: 0s; |
This file contains hidden or 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
<#assign newList = [] /> | |
<#list response.data.items as originalList> | |
<#if ! newList?seq_contains(originalList.xValue)> | |
<#assign newList = newList + [originalList.xValue] /> | |
</#if> | |
</#list> |
This file contains hidden or 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
public static ArrayList<E> getFunction(Object x, int level, ArrayList<E> list) { | |
if (level == 1) { | |
Object x2 = DB.getInstance().getObjectById(x.getID()); | |
list.add(x2); | |
return list; | |
} else { | |
Object x2 = DB.getInstance().getObjectById(x.getID()); | |
level = level - 1; | |
list.add(x2); | |
return getFunction(x2, level, list); |
This file contains hidden or 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
this.array = []; | |
selectCarouselItem(itemToAdd) { | |
if (this.array.indexOf(itemToAdd) != -1) { | |
this.array.splice(this.array.indexOf(itemToAdd), 1) | |
} else { | |
this.array.push(itemToAdd); | |
} | |
} |
This file contains hidden or 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
merge_array(array1, array2, array3) { | |
const result_array = []; | |
array1.concat(array2, array3).forEach(item => { | |
if (result_array.indexOf(item) == -1) | |
result_array.push(item); | |
}); | |
return result_array; | |
} |
This file contains hidden or 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
merge_array(array1, array2) { | |
const result_array = []; | |
const arr = array1.concat(array2); | |
let len = arr.length; | |
const assoc = {}; | |
while (len--) { | |
const item = arr[len]; | |
if (!assoc[item]) { |