Skip to content

Instantly share code, notes, and snippets.

View gibrandev's full-sized avatar
🏠
Working from home

Gibran Dimasagung gibrandev

🏠
Working from home
View GitHub Profile
@gibrandev
gibrandev / nginx device redirect
Created July 15, 2024 00:40 — forked from mariusom/nginx device redirect
Nginx detecting desktop, tablet or mobile by looking tat the http user agent.
# Source: http://detectmobilebrowsers.com/
set $mobile_rewrite do_not_perform;
if ($http_user_agent ~* "(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino") {
set $mobile_rewrite perform;
}
if ($http_user_agent ~* "^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|t
@gibrandev
gibrandev / switch.vue
Created March 6, 2024 09:53
Switch button
<script setup>
const check = reactive({
input: [
true,
false
]
})
const changeCheckbox = (e, i) => {
console.log(e.target.checked);
@gibrandev
gibrandev / comment.sh
Created February 12, 2024 03:42
Comment API
curl 'https://comment.arkadia.me/api/comment?url=https://www.suara.com/bisnis/2024/01/26/103736/sri-mulyani-siap-mundur-menteri-ekonomi-jokowi-yang-paling-punya-kredibilitas&page=1' \
-H 'authority: comment.arkadia.me' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: en-US,en;q=0.9,id-ID;q=0.8,id;q=0.7' \
-H 'cache-control: no-cache' \
-H 'pragma: no-cache' \
-H 'referer: https://comment.arkadia.me/?url=https://www.suara.com/bisnis/2024/01/26/103736/sri-mulyani-siap-mundur-menteri-ekonomi-jokowi-yang-paling-punya-kredibilitas&title=Sri%20Mulyani%20Siap%20Mundur,%20Menteri%20Ekonomi%20Jokowi%20yang%20Paling%20Punya%20Kredibilitas&site_name=suara.com&content_id=2064015&category=bisnis&category_id=2&is_regional=0&regional_name=&is_mitra=0&mitra_name=&mitra_id=&publish_date=2024-01-26%2010:37:36' \
-H 'sec-ch-ua: "Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "Windows"' \
@gibrandev
gibrandev / index.js
Created November 9, 2022 09:29
Socket io dynamic rooms
const express = require("express");
const { createServer } = require("http");
const { Server } = require("socket.io");
const app = express();
const httpServer = createServer(app);
const io = new Server(httpServer, {
cors: {
origin: "*",
<p>Donec ornare lacus ac est fermentum, eu elementum ligula eleifend. Praesent nibh mi, tincidunt ac ipsum eget, tincidunt dictum mi. Suspendisse sodales congue scelerisque. Nulla iaculis ligula purus, et sagittis nisl facilisis sed. Donec sed tempor justo. Etiam at tortor lacinia, dapibus nunc quis, varius nulla. Etiam ornare tortor nisl, in malesuada erat pellentesque quis. Phasellus id libero sed ligula ultrices commodo.</p><p>Donec ornare lacus ac est fermentum, eu elementum ligula eleifend. Praesent nibh mi, tincidunt ac ipsum eget, tincidunt dictum mi. Suspendisse sodales congue scelerisque. Nulla iaculis ligula purus, et sagittis nisl facilisis sed. Donec sed tempor justo. Etiam at tortor lacinia, dapibus nunc quis, varius nulla. Etiam ornare tortor nisl, in malesuada erat pellentesque quis. Phasellus id libero sed ligula ultrices commodo.</p>
<h2>Donec sed tempor justo. Etiam at tortor lacinia</h2>
<p></p>
<p>Donec ornare lacus ac est fermentum, eu elementum ligula eleifend. Praesent nibh mi, tincidun
{
"_id" : ObjectId("5ea5ea8eb97c84425d274643"),
"judul" : "Testing rijek admin abaikan saja",
"deskripsi" : "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printe",
"konten" : "<span style=\"font-weight: 700; margin: 0px; padding: 0px; color: rgb(0, 0, 0); font-family: &quot;Open Sans&quot;, Arial, sans-serif; letter-spacing: normal; text-align: justify;\">Lorem Ipsum</span><span style=\"color: rgb(0, 0, 0); font-family: &quot;Open Sans&quot;, Arial, sans-serif; letter-spacing: normal; text-align: justify;\">&nbsp;is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popu
@gibrandev
gibrandev / admin_message.json
Last active July 9, 2021 03:16
Admin message
{
"_id" : ObjectId("60e3fd2f14520000d40034dd"),
"ticket_id" : "60e3ede68e3300009e0007ac",
"admin" : {
"id" : 123,
"name" : "Admin Arkadia",
"avatar" : "https://images.unsplash.com/photo-1574660430699-41d4a2d9c988?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&h=750&q=80"
},
"message" : "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec accumsan, urna faucibus suscipit elementum, risus augue euismod magna, sit amet sodales purus enim quis enim. Vivamus efficitur nec elit vitae maximus. Vestibulum a turpis sapien. Aenean pretium magna eu pulvinar porta. Sed scelerisque elementum enim.",
"attachments" : [