Skip to content

Instantly share code, notes, and snippets.

@lopspower
lopspower / README.md
Last active May 3, 2024 13:26
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@davision
davision / vue2-countdown.vue
Last active May 3, 2024 13:22
Simple countdown component for VueJS 2
<template lang="html">
<div v-if="isEnded">
Ended.
</div>
<div v-else>
<div>Days: {{ days }}</div>
<div>Hours: {{ hours }}</div>
<div>Minutes: {{ minutes }}</div>
<div>Seconds: {{ seconds }}</div>
@r0mdau
r0mdau / find-k8snode-interface.sh
Last active May 3, 2024 13:21
How to get tcpdump for containers inside Kubernetes pods
# find the kube node of the running pod, appear next to hostIP, and note containerID hash
kubectl get pod mypod -o json
# -> save hostIP
# -> save containerID
# connect to the node and find the pods unique network interface index inside it's container
docker exec containerID /bin/bash -c 'cat /sys/class/net/eth0/iflink'
# -> returns index
# locate the interface of the node
@m-Phoenix852
m-Phoenix852 / discord-token-logger.js
Created August 26, 2020 07:45
Simple script to log in to discord account using token.
let token = "your token";
function login(token) {
setInterval(() => {
document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"`
}, 50);
setTimeout(() => {
location.reload();
}, 2500);
}
// 1. Pastikan local supabase sudah linked dengan supabase online
// 2. `npx supabase storage ls ss:///[bucket-name]/[path-to-folder]/ --experimental`
// 3. Copy semua nama file pada storage di array images_tournaments_logos atau rename sesuai keinginan
import { createClient } from '@supabase/supabase-js'
const supabaseOnline = createClient("[URL-SUPABASE-ONLINE]", "[SUPABASE-ONLINE-ANON-KEY]");
const supabaseSelfHost = createClient("[URL-SUPABASE-SELF-HOST]", "[SUPABASE-SELF-HOST-ANON-KEY]");
const images_tournaments_logos = [

Basic Methods

Prefix Method
imp→ import moduleName from 'module'
imn→ import 'module'
imd→ import { destructuredModule } from 'module'
ime→ import * as alias from 'module'
ima→ import { originalName as aliasName} from 'module'
exp→ export default moduleName
@devajmeireles
devajmeireles / gist:77951cd44f71da945d0a9de4d675d3bc
Created March 25, 2024 22:45
Laravel Sanctum, Postman Pre-script
pm.sendRequest({
url: pm.environment.get('APP_URL') + 'sanctum/csrf-cookie',
method: 'GET'
}, function (error, response, { cookies }) {
if (!error) {
pm.environment.set('XSRF_TOKEN', cookies.get('XSRF-TOKEN'))
}
})
pm.sendRequest({
url: pm.environment.get('APP_URL') + 'sanctum/csrf-cookie',
method: 'GET'
}, function (error, response, { cookies }) {
if (!error) {
pm.environment.set('XSRF_TOKEN', cookies.get('XSRF-TOKEN'))
}
})
@GoodbyeNJN
GoodbyeNJN / 墓碑模式FCM推送v3.0-b.json
Last active May 3, 2024 13:14
墓碑模式 FCM 推送
[
{
"name": "墓碑模式FCM推送v3.0-b",
"description": "对于支持FCM推送的 **非黑名单** 应用,当其收到推送并且处于后台时,临时解冻3秒。\n仅适配了NoActive Pro版本。全局变量示例:[ \"0#com.tencent.mm\", \"10#com.tencent.mm\" ],井号前后分别为用户id和包名。",
"priority": -1,
"condition": "fcmPushMessageArrived == true",
"actions": [
"def debug(msg) { log.log(\"🚀 \" + msg); } def getUserIdList() { userList = context.getSystemService(context.USER_SERVICE).getUsers(); userIdList = (identifier in (userHandle in userList)); return userIdList; } def isValidPkg(pkg) { return thanos.getPkgManager().getAppInfo(pkg) != null; } def getPkgListByPkgName(pkgName) { userIdList = getUserIdList(); res = []; foreach(userId: userIdList) { pkg = Pkg.newPkg(pkgName, userId); if (isValidPkg(pkg)) { res.add(pkg.userId + \"#\" + pkg.pkgName); } } return res; } def isPkgFrozen(pkg) { return su.exe(\"pm freezer query \" + pkg + \" | awk '/isFrozen/ {print $2}'\").out[0]; } def unfreezePkg(pkg) { su.exe(\"pm freezer temporaryThaw \" + pkg); } def checkGlobalVar(pkg) { if (globalVar