Skip to content

Instantly share code, notes, and snippets.

View AmgedOsman's full-sized avatar

Amged Osman AmgedOsman

View GitHub Profile
<script type='text/javascript' src='{$this->settings['public_dir']}js/ips.pokes.js'></script>
<script type='text/javascript'>
ipb.vars['poke_mname'] = '{$member['members_display_name']}';
</script>
<if test="$this->memberData['member_id'] != $member['member_id']">
<li class='ipsButton_secondary' id="pokeMeHide"><a class='' id='pokeMe' href="{$this->settings['base_url']}app=pokes&amp;module=pokes&amp;section=pokes&amp;do=poke&amp;type=1&amp;id={$member['member_id']}&amp;mname={$member['members_display_name']}&amp;secure_key={$this->member->form_hash}"><img src="{$this->settings['public_dir']}style_extra/pokes/poke.png" />&nbsp;{$this->lang->words['poke']}</a>
</li>
</if>
<script type='text/javascript' src='{$this->settings['public_dir']}js/ips.pokes.js'></script>
<script type='text/javascript'>
ipb.vars['poke_mname'] = '{$member['members_display_name']}';
</script>
<if test="$this->memberData['member_id'] != $member['member_id']">
<li class='ipsButton_secondary' id="pokeMeHide"><a class='' id='pokeMe' href="{$this->settings['base_url']}app=pokes&amp;module=pokes&amp;section=pokes&amp;do=poke&amp;type=1&amp;id={$member['member_id']}&amp;mname={$member['members_display_name']}&amp;secure_key={$this->member->form_hash}"><img src="{$this->settings['public_dir']}style_extra/pokes/poke.png" />&nbsp;{$this->lang->words['poke']}</a>
</li>
</if>
@AmgedOsman
AmgedOsman / bleh
Created October 24, 2013 02:52
hmm
<script type='text/javascript' src='{$this->settings['public_dir']}js/ips.pokes.js'></script>
<script type='text/javascript'>
ipb.vars['poke_mname'] = '{$member['members_display_name']}';
</script>
<if test="$this->memberData['member_id'] != $member['member_id']">
<li class='ipsButton_secondary' id="pokeMeHide"><a class='' id='pokeMe' href="{$this->settings['base_url']}app=pokes&amp;module=pokes&amp;section=pokes&amp;do=poke&amp;type=1&amp;id={$member['member_id']}&amp;mname={$member['members_display_name']}&amp;secure_key={$this->member->form_hash}"><img src="{$this->settings['public_dir']}style_extra/pokes/poke.png" />&nbsp;{$this->lang->words['poke']}</a>
</li>
</if>
<script type='text/javascript' src='{$this->settings['public_dir']}js/ips.pokes.js'></script>
<script type='text/javascript'>
ipb.vars['poke_mname'] = '{$member['members_display_name']}';
</script>
<if test="$this->memberData['member_id'] != $member['member_id']">
<li class='ipsButton_secondary' id="pokeMeHide"><a class='' id='pokeMe' href="{$this->settings['base_url']}app=pokes&amp;module=pokes&amp;section=pokes&amp;do=poke&amp;type=1&amp;id={$member['member_id']}&amp;mname={$member['members_display_name']}&amp;secure_key={$this->member->form_hash}"><img src="{$this->settings['public_dir']}style_extra/pokes/poke.png" />&nbsp;{$this->lang->words['poke']}</a>
</li>
</if>
<script type='text/javascript' src='{$this->settings['public_dir']}js/ips.pokes.js'></script>
<script type='text/javascript'>
ipb.vars['poke_mname'] = '{$member['members_display_name']}';
</script>
<if test="$this->memberData['member_id'] != $member['member_id']">
<li class='ipsButton_secondary' id="pokeMeHide"><a class='' id='pokeMe' href="{$this->settings['base_url']}app=pokes&amp;module=pokes&amp;section=pokes&amp;do=poke&amp;type=1&amp;id={$member['member_id']}&amp;mname={$member['members_display_name']}&amp;secure_key={$this->member->form_hash}"><img src="{$this->settings['public_dir']}style_extra/pokes/poke.png" />&nbsp;{$this->lang->words['poke']}</a>
</li>
</if>

Twitter autoresponder bot

By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.

Could be modified to be more advanced (match regular expressions to answer questions, etc.)

Questions? See my blog post - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa

Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1

Twitter autoresponder bot
=========================
By Daniel15 (dan.cx)
This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.
Could be modified to be more advanced (match regular expressions to answer questions, etc.)
By Iskigow
Added Match regular expressions...
function removeEmoji($text)
{
$cleanText = "";
// Match Emoticons
$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u';
$cleanText = preg_replace($regexEmoticons, '', $text);
// Match Miscellaneous Symbols and Pictographs
$regexSymbols = '/[\x{1F300}-\x{1F5FF}]/u';
@AmgedOsman
AmgedOsman / Database.php
Created March 21, 2016 03:58
PHP MySQLi Database Class Object oriented style based on https://gist.github.com/jonashansen229/4534794
<?php
/*
* Mysql database class - only one connection alowed
//https://gist.github.com/jonashansen229/4534794
//$db = Database::getInstance();
//$mysqli = $db->getConnection();
//$sqlbuildQuery = "SELECT foo FROM .....";
//$result = $mysqli->query($sqlbuildQuery);
*/
class Database {
<?php
/**
* Functions
*
* @package amgeddotme2017
*/
/**
Updating the below article to work with Bootstrap 4