Skip to content

Instantly share code, notes, and snippets.

@dvygolov
dvygolov / ywbegfilter.php
Last active January 31, 2024 07:03
Фильтр для трекера Кейтаро (https://yellowweb.top/keitaro), реализующий Эпсилон-жадный алгоритм многоруких бандитов.
<?php
namespace Filters;
use Core\Filter\AbstractFilter;
use Core\Locale\LocaleService;
use Traffic\Model\StreamFilter;
use Traffic\RawClick;
/*
Кастомный фильтр для Кейтаро для реализации работы Эпсилон-жадного алгоритма многоруких бандитов.
@dvygolov
dvygolov / getadsmanagertokenbyloginpass.php
Created July 10, 2020 10:31
Get Ads Manager Access Token Using FB Login and Password
<?php
//Код взят отсюда: https://t.me/bearded_cpa/94
$login_email = 'Login';
$login_pass = 'Pass';
$url_first='https://m.facebook.com/login.php';
$url_second = 'https://www.facebook.com/adsmanager';
$ch = curl_init();
@cafielo
cafielo / UIDevice+Notch.swift
Created October 18, 2018 16:36
how to detect notch device in swift
extension UIDevice {
var hasNotch: Bool {
let bottom = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0
return bottom > 0
}
}
if UIDevice.current.hasNotch {
//... consider notch
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Last active December 28, 2024 22:56
This repository showcases a simple and effective script to send push notifications to Android devices using Firebase Cloud Messaging (FCM). Designed for developers, the code provides a quick setup for integrating FCM notifications with minimal configuration.
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',
@wangmuy
wangmuy / reload-path.bat
Last active January 18, 2024 15:02
refresh path in windows shell
@echo off
echo.
echo Refreshing PATH from registry
setlocal EnableDelayedExpansion
:: Get System PATH
for /f "tokens=3*" %%A in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path') do set syspath=%%A%%B
:: Get User Path
for /f "tokens=3*" %%A in ('reg query "HKCU\Environment" /v Path') do set userpath=%%A%%B
@zacwest
zacwest / ios-font-sizes.swift
Last active September 25, 2025 07:59
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
@fabrizim
fabrizim / acf-customizer-patch.php
Last active May 31, 2025 20:56
Plugin to allow for Advanced Custom Fields to be used in widgets within the Customizer
<?php
/*
Plugin Name: ACF Customizer Patch
Plugin URI: https://gist.github.com/fabrizim/9c0f36365f20705f7f73
Description: A class to allow acf widget fields to be stored with normal widget settings and allow for use in customizer.
Author: Mark Fabrizio
Version: 1.0
Author URI: http://owlwatch.com/
*/
class acf_customizer_patch
@Whitexp
Whitexp / facebok ip list
Last active September 2, 2025 20:38
facebook ip list
31.13.24.0/21
31.13.64.0/19
31.13.64.0/24
31.13.69.0/24
31.13.70.0/24
31.13.71.0/24
31.13.72.0/24
31.13.73.0/24
31.13.75.0/24
31.13.76.0/24
@stuartsierra
stuartsierra / fresh-chrome.sh
Last active May 10, 2025 11:01
Launch new instances of Google Chrome on OS X with isolated cache, cookies, and user config
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every