Skip to content

Instantly share code, notes, and snippets.

View AliMilani's full-sized avatar

Ali Milani AliMilani

View GitHub Profile
// WebView
(function () {
var eventHandlers = {};
var locationHash = "";
try {
locationHash = location.hash.toString();
} catch (e) {}
var initParams = urlParseHashParams(locationHash);
<html>
<body>
Welcome <?php echo $_POST["username"]; ?><br>
</body>
</html>
@AliMilani
AliMilani / spotify.sh
Last active November 12, 2023 10:44
skip spotify ads
kill spotify
spotify --test1
sleep 2
wmctrl -Fr "Spotify" -b add,shaded
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
#Alt + 1 / Custom Shortcuts | /home/USERNAME/scripts/spotify.sh
@AliMilani
AliMilani / spotify_keybindings
Created November 12, 2023 09:31 — forked from jbonney/spotify_keybindings
Spotify - Linux key bindings. From XFCE / Ubuntu keyboard shortcuts configuration, assign the control command to their key. http://shkspr.mobi/blog/2011/12/linux-spotify-keybindings/
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious
@AliMilani
AliMilani / postman_test.js
Last active July 22, 2023 08:41
This Postman test extracts the "authorization" and "x-refresh-token" headers from the response and stores them in environment variables "USER_ACCESS_TOKEN" and "USER_REFRESH_TOKEN" if they exist.
// let data = JSON.parse(responseBody);
var authorization = pm.response.headers.get('authorization')
var refreshToken = pm.response.headers.get('x-refresh-token')
if (!authorization) return
if (authorization) pm.environment.set("USER_ACCESS_TOKEN", authorization?.split(' ')[1]);
if (refreshToken) pm.environment.set("USER_REFRESH_TOKEN", refreshToken);
@AliMilani
AliMilani / torob.js
Last active July 7, 2023 15:42
torob
const axios = require("axios");
require("dotenv").config();
const { toToman } = require("./helpers");
class TorobProduct {
/**
* @type {[Object]}
*/
#url;
@AliMilani
AliMilani / regex.js
Created April 16, 2023 12:15
filter persian and english words and numbers
/[^\w\s\-|\u0621-\u064A\u0660-\u0669\u06F0-\u06F9|\u06Af|\u067E|\u0698|\u0686|\u06CC|\u06A9|\u200C]/g
@AliMilani
AliMilani / whois.php
Last active April 15, 2023 08:20 — forked from kshitiz621/whois.php
PHP code to get WHOIS information of a domain
<?php
/*************************************************************************
php easy :: whois lookup script
==========================================================================
Author: php easy code, www.phpeasycode.com
Web Site: http://www.phpeasycode.com
Contact: webmaster@phpeasycode.com
*************************************************************************/
$domain = $_GET['domain'];
/^\S+@\S+\.\S+$/
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/