Skip to content

Instantly share code, notes, and snippets.

View vishnu1991's full-sized avatar
🎯
Focusing

Vishnu vishnu1991

🎯
Focusing
View GitHub Profile
@swinton
swinton / settings.py
Created September 12, 2012 20:26
Example of connecting to the Twitter user stream using Requests.
# OAuth stuff...
ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"
ACCESS_TOKEN_SECRET = "YOUR_ACCESS_TOKEN_SECRET"
CONSUMER_KEY = "YOUR_CONSUMER_KEY"
CONSUMER_SECRET = "YOUR_CONSUMER_SECRET"
@AbhishekGhosh
AbhishekGhosh / mailportcheck.php
Created February 27, 2016 22:41
Check Port 25, 465, 587 whether open via PHP
<?php
// 5 is the timeout in seconds
// 25 is port, other ports you may check are 465 and 587
$fp = fsockopen('127.0.0.1', 25, $errno, $errstr, 5);
if (!$fp) {
} else {
fclose($fp);
}
?>
@alobato
alobato / facebook-dl
Created September 18, 2014 17:15
Download a Facebook video with one line
# Ex.: https://www.facebook.com/video.php?v=469066063208329
video=469066063208329; curl -s $(curl -s https://www.facebook.com/video.php?v=$video | grep -o 'https.*thumbnail_src' | sed 's/\\u00253A/:/g' | sed 's/\\u00255C\\u00252F/\//g' | sed 's/\\u002526/\&/g' | sed 's/\\u00253D/=/g' | sed 's/\\u00253F/?/g' | sed 's/\\u002522\\u00252C\\u002522thumbnail_src//g') > $video.mp4
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@unnikked
unnikked / index.php
Created January 5, 2016 22:02
InlineDuckBot
<?php
require("./vendor/autoload.php");
define('BOT_TOKEN', 'token');
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/');
function apiRequestWebhook($method, $parameters) {
if (!is_string($method)) {
error_log("Method name must be a string\n");
@hnq90
hnq90 / CheckEmoji.php
Created November 26, 2014 10:18
Check Emoji exist in string
/**
* Check emoji from string
*
* @return bool if existed emoji in string
*/
function checkEmoji($str)
{
$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u';
preg_match($regexEmoticons, $str, $matches_emo);
if (!empty($matches_emo[0])) {
[
{
"author": "Abraham Lincoln",
"quote": "Things may come to those who wait, but only the things left by those who hustle.",
"image": "http://upload.wikimedia.org/wikipedia/commons/1/1b/Abraham_Lincoln_November_1863.jpg"
},
{
"author": "Adam Smith",
"quote": "The great secret of education is to direct vanity to proper objects.",
@battis
battis / emoji.php
Last active October 5, 2021 20:15
Trying to store/retrieve/display Unicode emoji in a MySQL database
<?php
// MySQL schema
/*
CREATE TABLE `test` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`text` text,
`blob` blob,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Okay, Kids, Here We Go...

"What You Need To Know About Your Next Domain Name"

I highly respect what Fred has done, and continues to do, to help entrepreneurs and for that I'd like to "give back" myself... and I'm posting anonymously as I have nothing to gain in anyway by sharing this information...

I'm a serial Internet entrepreneur since 1990 (pre-Web). I've been involved in hundreds of projects online (have built more than one Top 500 web site) and I've been a very active and successful domain name 'trader' along the way.

I've personally owned over 50,000 domains on and off during the past 15+ years. I've been involved in some million$+ deals, and have owned some domains that you know of (but I won't name). I've also been involved in 1,000s of smaller deals. So this is a topic I know very well.

@visitdigital
visitdigital / webhook.php
Last active September 20, 2022 02:51
Very Simple Facebook Chat Bot PHP Webhook Script Example
<?php
$challenge = $_REQUEST['hub_challenge'];
$verify_token = $_REQUEST['hub_verify_token'];
// Set this Verify Token Value on your Facebook App
if ($verify_token === 'testtoken') {
echo $challenge;
}
$input = json_decode(file_get_contents('php://input'), true);