Skip to content

Instantly share code, notes, and snippets.

View 0xSG's full-sized avatar
💻
ᴡᴏʀᴋ 🎧

ѕσσяуα gαηgαяαנ 0xSG

💻
ᴡᴏʀᴋ 🎧
View GitHub Profile
@0xSG
0xSG / sample-videos.json
Created March 29, 2025 17:22
public test videos | sample videos
[
{
"video_url": "https://cdn.pixabay.com/video/2024/03/12/203923-922675870_large.mp4",
"thumbnail_url": "",
"tags": "grass, field, wind, flowers, nature",
"duration": 21,
"user": "RuslanSikunov",
"userImageURL": "https://cdn.pixabay.com/user/2025/03/14/08-57-21-981_250x250.jpg"
},
{
@0xSG
0xSG / gist:e7655ef8227e6cb4c7be0a8d807f2e96
Created December 28, 2023 13:07
Firebase verify_token
# In your Django views.py
from firebase_admin import auth
def verify_token(request):
id_token = request.POST.get('idToken') # Adjust depending on how you send the token
try:
# Verify the ID token while checking if the token is revoked by passing check_revoked=True.
decoded_token = auth.verify_id_token(id_token, check_revoked=True)
uid = decoded_token['uid']
@0xSG
0xSG / dnsmasq OS X.md
Created October 18, 2022 16:52 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@0xSG
0xSG / shimmer-effect.css
Created February 12, 2022 13:37
Shimmer effect CSS
.shimmer {
animation : shimmer 2s infinite;
background: linear-gradient(to right, #eff1f3 4%, #e2e2e2 25%, #eff1f3 36%);
background-size: 1000px 100%;
}
@keyframes shimmer {
0% {
background-position: -1000px 0;
}
@0xSG
0xSG / subStringAroundKeyword.js
Last active January 3, 2022 13:40
Sub string around a keyword in javascript
/**
* Returns a sub-string with the specified keyword in the middle.
* @param text: Full statement with the keyword in it.
* @param keyword: Keyword which you want to concentrate.
* @param subStringLen: The length of the desired resultant string.
* @param truncate: If true it will add '...' at the starting and ending of the resultant string.
* @author sooryagangaraj
* @return string
*/
function subStringAroundKeyword(text, keyword, subStringLen, truncate = true) {
@0xSG
0xSG / example.rtf
Created October 18, 2020 12:57
Set border, color, width from interface builder
layer.cornerRadius
layer.borderWidth
layer.borderColor
@0xSG
0xSG / project-structure.txt
Last active October 18, 2020 07:47
File Structure for XCode Project.
PROJECT STRUCTURE
├─ Global
├─ Application
├─ Main
├─ Target B
├─ Storyboards
├─ View Controllers
├─ Models
├─ Common Utils
@0xSG
0xSG / DispatchQueue-main-asyncAfter.swift
Created October 17, 2020 14:25
DispatchQueue main asyncAfter
DispatchQueue.main.asyncAfter(deadline: .now() + <#delaySeconds#>, execute: {
<#Statements#>
})
@0xSG
0xSG / background-process.swift
Created October 17, 2020 14:24
Background execution of statements swift 4
let dispatchQueue = DispatchQueue(label: "<#background process id#>", qos: .background)
dispatchQueue.async{
<#statements#>
}
@0xSG
0xSG / brew-update.sh
Created October 17, 2020 14:18
Brew update for Mac
$ cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update