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
const response = []; | |
var promises = []; | |
var i = 44; | |
while(i <= 46){ | |
promises.push( | |
fetch('https://jsonplaceholder.typicode.com/posts/'+i.toString()).then(result =>{ | |
return result.json() | |
}).then( jsonResult => { | |
return jsonResult; | |
}) |
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
var cWrap=$('<pre>'); | |
$('.w-richtext h6').each(function(){ | |
var o = $(this).next('h6').length; | |
console.log(o); | |
$(this).replaceWith(cWrap).appendTo(cWrap); | |
if (!o) cWrap=$('<pre />'); | |
}); |
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
{ | |
"workbench.iconTheme": "material-icon-theme", | |
"workbench.welcome.enabled": false, | |
"editor.fontSize": 13, | |
"editor.tabSize": 2, | |
"editor.wordWrapColumn": 80, | |
"editor.snippetSuggestions": "top", | |
"editor.minimap.enabled": true, | |
"files.exclude": { | |
"**/.git": true, |
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
var e = document.createElement('script'); | |
e.setAttribute('src', 'https://nytimes.github.io/svg-crowbar/svg-crowbar.js'); | |
e.setAttribute('class', 'svg-crowbar'); | |
document.body.appendChild(e); |
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
require 'open-uri' | |
require 'nokogiri' | |
require 'securerandom' | |
namespace :Scrap do | |
desc "code structure for new scrapper" | |
task :sample => :environment do | |
src = "" # define the source of the article | |
url_to_scrap = "" # define the url where scrap the article can be the same as src |
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
require 'open-uri' | |
require 'nokogiri' | |
def getPageResult (html_data) | |
$data_array = [] | |
list_ads = html_data.css('.list-lbc a') | |
list_ads.each { |add| | |
url = add['href'] | |
title = add.css('.detail .title').text.gsub(/\s+/,' ') |
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
var Hello = React.createClass({ | |
getOffset : function(element){ | |
var bounding = element.getBoundingClientRect(); | |
return { | |
top: bounding.top + document.body.scrollTop, | |
left: bounding.left + document.body.scrollLeft | |
}; | |
}, |
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
.ui-datepicker { | |
background-color: #fff; | |
border: 1px solid #66AFE9; | |
border-radius: 4px; | |
box-shadow: 0 0 8px rgba(102,175,233,.6); | |
display: none; | |
margin-top: 4px; | |
padding: 10px; | |
width: 240px; | |
} |