Skip to content

Instantly share code, notes, and snippets.

View parsibox's full-sized avatar

Mohsen Davari parsibox

View GitHub Profile
//بیخال شدن از تغییرات تا الان
git reset --hard
var walAddress="0xd10b684DB06fc09A2f6B2744DeF46c81673Fb8c2"
var nextRunTimeRandom;
var isExecuting = false;
function getRandomTime() {
nextRunTimeRandom =Math.floor(Math.random() * 111) + 125;
return nextRunTimeRandom;
}
// Function to create the div and apply the style
function createLastRunTimeDiv() {
@parsibox
parsibox / kannel.go
Created March 31, 2024 13:28
convert receive sms from kannel to utf8 with emoji
package main
import (
"fmt"
"net/url"
"strings"
"unicode/utf16"
)
func main() {
@parsibox
parsibox / gist:6b62d2c2e68f7473b0e6ebac271aae8f
Created March 21, 2024 11:39
php fix iran time zone problem
/usr/local/php74/bin/pecl install timezonedb
You should add "extension=timezonedb.so" to php.ini
@parsibox
parsibox / build.bat
Created March 9, 2024 07:43
windows command for goland to build go for linux os and then compress file with upx and then open folder in explorer
$Env:GOOS = "linux" ; $Env:GOARCH = "amd64"; go build -o TelircoEsbLog -ldflags "-w -s" ../main.go ; C:\portable\upx-4.0.2-win64\upx.exe TelircoEsbLog ; explorer .
gdb `which php82`
run xxx.php
bt
@parsibox
parsibox / gist:4c82fc55c9316f97a1fc22aac6c1fa95
Created February 15, 2024 08:56
log all queries using the following queries:
$ mongo
MongoDB shell version: 2.4.9
connecting to: test
> use myDb
switched to db myDb
@parsibox
parsibox / ip.php
Created January 19, 2024 09:48
server ip with api
<?php
// Make a request to ipify API
$apiUrl = 'https://api.ipify.org?format=json';
$response = file_get_contents($apiUrl);
// Check if the request was successful
if ($response !== false) {
// Decode the JSON response
$data = json_decode($response, true);
rateLimit := time.Second / 100 // 100 messages per second
throttle := time.NewTicker(rateLimit)
for msg := range msgs {
<-throttle.C // Wait for the next tick
go handle(msg) // Process the message
}
@parsibox
parsibox / Screenshot.go
Created November 10, 2023 04:48
golang Screenshot
package main
import (
"context"
"io/ioutil"
"log"
"time"
"github.com/chromedp/chromedp"
)