Skip to content

Instantly share code, notes, and snippets.

import axios from 'axios';
(async () => {
const { data: users } = await axios('https://jsonplaceholder.typicode.com/users');
const { data: post1 } = await axios('https://jsonplaceholder.typicode.com/posts/1');
const { data: post2 } = await axios('https://jsonplaceholder.typicode.com/posts/2');
console.log('users', users);
async function getData() {
const users = await (
await fetch('https://jsonplaceholder.typicode.com/users')).json();
const post1 = await (
await fetch('https://jsonplaceholder.typicode.com/posts/1')).json();
const post2 = await (
await fetch('https://jsonplaceholder.typicode.com/posts/2')).json();
(()=>{
console.log('merhaba');
})();
//async
(async()=>{
console.log('merhaba');
})();
const sayHi = (cb) => {
cb();
}
sayHi(()=>{
console.log('hello');
});
fetch('https://jsonplaceholder.typicode.com/users')
.then((data) => data.json())
.then((users) => {
console.log('users yuklendi!',users);
fetch('https://jsonplaceholder.typicode.com/posts/1')
.then((data) => data.json())
.then((posts) => {
console.log('post 1 yüklendi',posts)
fetch('https://jsonplaceholder.typicode.com/posts/2')
{
"func": {
"prefix": "func",
"body": [
"function (${param}) { }"
],
"description": "An anonymous function."
},
"jqAfter": {
"prefix": "jqAfter",
! function(f, a, c) {
var s, l = 256,
p = "random",
d = c.pow(l, 6),
g = c.pow(2, 52),
y = 2 * g,
h = l - 1;
function n(n, t, r) {
function e() {
@mertcanaltin
mertcanaltin / wordpress-get-post.php
Last active November 10, 2020 11:52
wordpress post yazı çekmek için
<div class="container">
<section class="row index-pizza-blog-footer-bottom">
<?php
$args = array(
'post_type' => 'post',
'orderby' => 'rand',
'posts_per_page' => -1,
);
$loop = new WP_Query( $args );
@mertcanaltin
mertcanaltin / get-products.js
Created October 29, 2020 11:03
Wordpress Woocommerce Graphql Get Products query
import React from "react"
import { graphql } from "gatsby"
const ComponentName = ({ data }) => <pre>{JSON.stringify(data, null, 4)}</pre>
export const query = graphql`
{
products {
edges {
node {
@mertcanaltin
mertcanaltin / whatsapp-emoji-en.js
Created February 21, 2020 23:45
whatsapp emoji list code
/*! mertcanaltin. */
webpackJsonp([126], {
bhiedjfcbg: function(e, a) {
e.exports = {
0: ["0⃣"],
1: ["1⃣", "🕐", "🕜"],
2: ["🕑", "2⃣", "🕝"],
3: ["🕒", "🕞", "3⃣"],
4: ["🕓", "🍀", "🕟", "4⃣"],
5: ["🕠", "5⃣", "🕔"],