This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class curl_get_image{ | |
private $image_name = ""; | |
private $data = ""; | |
private $dir = ""; | |
private $details = array(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Getting a JSON Facebook Feed | |
========================================================================== | |
1. Sign in as a developer at https://developers.facebook.com/ | |
2. Click "Create New App" at https://developers.facebook.com/apps | |
3. Under Apps Settings, find the App ID and App Secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Check if the user has submitted the form. | |
*/ | |
if ($_SERVER['REQUEST_METHOD'] === 'POST') { | |
/** | |
* Print the $_FILES global variable. This will display the following: | |
* array(1) { | |
* ["myfiles"]=> array(6) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get browser language, optionally passing a list of available languages. | |
* | |
* @param [array] $available_languages Available languages for the site | |
* @param [string] $default Default language for the site | |
* @return [string] Language code | |
*/ | |
function get_browser_language_code( $available_languages = [], $default = 'en' ) : string | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# If it redirects to http://www.facebook.com/login.php at the end, wait a few minutes and try again | |
EMAIL='YOUR_EMAIL' # edit this | |
PASS='YOUR_PASSWORD' # edit this | |
COOKIES='cookies.txt' | |
USER_AGENT='Firefox/3.5' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((document, location, navigator) => { | |
const domain = location.hostname.split(".") | |
const match = document.cookie.match(/(^|; ?)_ga=GA1\.\d\.(\d+\.\d+)(;|$)/) | |
// use existing client id or generate one | |
const cid = match ? match[2] : ~~(2147483648 * Math.random()) + "." + ~~(Date.now() / 1000) | |
// set cookie at highest possible domain level | |
for (let i = domain.length; i--;) { | |
const cookie = `_ga=GA1.${domain.length - i}.${cid}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use this script to test that your Telegram bot works. | |
# | |
# Install the dependency | |
# | |
# $ gem install telegram_bot | |
# | |
# Run the bot | |
# | |
# $ ruby bot.rb | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Worker Name: WPCSPC - Device based Cache | |
* Description: This worker is responsible for caching the requests based on the device type | |
* Based on Default Worker Version: 2.8.0 | |
* Version: 2.1.0 | |
* @link: https://wordpress.org/plugins/wp-cloudflare-page-cache/ | |
* @link: https://wordpress.org/support/topic/mobile-page-theme-and-cloudflare-caching-plugin-integration/ | |
* @author: Saumya Majumder | |
*/ | |
// Default cookie prefixes for cache bypassing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function downloadUnreadEmails() { | |
var sheet = SpreadsheetApp.create('Unread Emails'); | |
sheet.appendRow(['Sender', 'Subject']); | |
var threads = GmailApp.search('is:unread'); | |
for (var i = 0; i < threads.length; i++) { | |
var messages = threads[i].getMessages(); | |
for (var j = 0; j < messages.length; j++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deleteEmails() { | |
var sheet = SpreadsheetApp.openById('SHEET ID').getSheetByName('Sheet1'); | |
var data = sheet.getDataRange().getValues(); | |
for (var i = 1; i < data.length; i++) { | |
var sender = data[i][0]; | |
var subject = data[i][1]; | |
var threads = GmailApp.search('is:read from:' + sender + ' subject:' + subject); | |
Logger.log('Deleted' + i + ' emails') |
OlderNewer