Skip to content

Instantly share code, notes, and snippets.

View index.html
<style>
.slider {
border-radius: 0.5rem;
margin: 1rem;
min-height: 15rem;
background: linear-gradient(
to right,
#314755,
#26a0da
); /* Default Background */
@Akifcan
Akifcan / slider.css
Created Mar 31, 2021
medium carousel article
View slider.css
.slider .slide-item {
cursor: grabbing;
scroll-snap-align: start;
flex-shrink: 0; /* We don't want to fit divs to parent element. So we'll use flex-shrink: 0 */
background-color: red;
width: 100%;
display: grid;
place-items: center;
font-size: 5rem;
}
@Akifcan
Akifcan / slider.css
Created Mar 31, 2021
medium carousel article
View slider.css
.slider {
border-radius: 0.5rem;
margin: 1rem;
min-height: 15rem;
background: linear-gradient(
to right,
#314755,
#26a0da
); /* Default Background */
box-shadow: 8px 7px 10px rgba(0, 0, 0, 0.5);
@Akifcan
Akifcan / index.html
Created Mar 31, 2021
medium carousel article
View index.html
<div class="slider">
<div class="slide-item" id="slide1">
😥
</div>
<div class="slide-item" id="slide2">
🤔
</div>
<div class="slide-item" id="slide3">
🥺
</div>
@Akifcan
Akifcan / log.js
Created Mar 23, 2021
real function
View log.js
exports = function(){
return context.http.get({ url: "http://gd.geobytes.com/GetCityDetails" })
.then(userInfo => {
const { geobytescountry, geobytesipaddress, geobytesfqcn } = EJSON.parse(userInfo.body.text())
const result = context.services.get("mongodb-atlas").db("cuties").collection("logs").insertOne({ geobytescountry, geobytesipaddress, geobytesfqcn });
return result
})
};
View save
// This function is the webhook's request handler.
exports = function(payload, response) {
const body = EJSON.parse(payload.body.text());
const result = context.services.get("mongodb-atlas").db("cuties").collection("pets").insertOne(body);
return result;
};
@Akifcan
Akifcan / post
Last active Mar 22, 2021
cuites-3
View post
exports = function(payload, response) {
const body = EJSON.parse(payload.body.text());
console.log(body.another)
return body;
};
View list-cuties.js
exports = function(payload, response) {
const pets = context.services.get("mongodb-atlas").db("cuties").collection("pets").find();
return pets
};
@Akifcan
Akifcan / cuties.json
Last active Mar 22, 2021
mongodb realm data
View cuties.json
[
{
"name": "Alice",
"imageUrl": "https://upload.wikimedia.org/wikipedia/commons/b/b1/VAN_CAT.png",
"pet": "cat",
"likes": 15
},
{
"name": "Angel",
"imageUrl": "https://cdnuploads.aa.com.tr/uploads/Contents/2019/10/24/thumbs_b_c_fb8263ce4f9f43ebdc7634b0d1eb0a08.jpg?v=115427",
View searchsong3
const cheerio = require('cheerio')
const axios = require('axios')
async function searchSong(id, artistname, song) {
artistname = artistname.replace(/ /g, '+')
song = song.replace(/ /g, '+')
const response = await axios.get(`https://www.lyrics.com/lyric/${id}/${artistname}/${song}`) //sayfa kaynak kodunu alıyoruz
const $ = cheerio.load(response.data) // ve kaynak kodunu cheerioya yüklüyoruz
const lyrcis = $('.lyric-body').text(); //az önce tarayıcı konsolunda cevabını aldığımız .lyric-body sınıfını uygulamamızdan aratıyoruz