Skip to content

Instantly share code, notes, and snippets.

View hackerrahul's full-sized avatar
💻

HackerRahul hackerrahul

💻
View GitHub Profile
<script src="https://www.w3schools.com/lib/w3.js"></script>
<p><button onclick="w3.sortHTML('#id01', 'li')" class="w3-button w3-blue">Sort</button></p>
<ul id="id01" class="w3-ul w3-white w3-border w3-margin">
<li>Oslo</li>
<li>Stockholm</li>
<li>Helsinki</li>
<li>Berlin</li>
<li>Rome</li>
<li>Madrid</li>
</ul>
<table id="myTable" class="w3-table-all">
<tr>
<th onclick="w3.sortHTML('#myTable', '.item', 'td:nth-child(1)')" style="cursor:pointer" class='w3-hover-grey'>Country <i class="fa fa-sort" style="font-size:13px;"></i></th>
<th onclick="w3.sortHTML('#myTable', '.item', 'td:nth-child(2)')" style="cursor:pointer" class='w3-hover-grey'>Capital <i class="fa fa-sort" style="font-size:13px;"></i></th>
</tr>
<tr class="item">
<td>India</td>
<td>New Delhi</td>
</tr>
<tr class="item">
{
"status": 200,
"status_message": "success",
"data": {
"string": "String you have passed",
"state": "Positive/Negative/Neutral",
"scores": {
"neg": 0,
"neu": 0,
"pos": 0,
<?php
function detect_sentiment($string){
$string = urlencode($string);
$api_key = "YOUR_API_KEY";
$url = 'https://api.paysify.com/sentiment?api_key='.$api_key.'&string='.$string.'';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
<?php
function check_balance($api_key){
$url = 'https://api.paysify.com/balance_api?api_key='.$api_key;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$response = json_decode($result,true);
curl_close($ch);
<?php
/**
* Upload version 1.0
* Created by HackerRahul http://HackerRahul.com
* Date 24 august 2015
*/
class Upload{
// make variables of parameters
private $_upload,
<?php
error_reporting(0);
function upload_to_imgur($image){
$image = file_get_contents($image);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.imgur.com/3/image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,