This file contains hidden or 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 | |
// define the path and name of cached file, | |
$cachefile = 'cache/'.urlencode($_SERVER['REQUEST_URI']).'.txt'; | |
// define how long we want to keep the file in seconds. | |
//$cachetime = 60*60*24; | |
$cachetime = 4; | |
// Check if the cached file is still fresh. If it is, serve it up and exit. | |
if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) { |
This file contains hidden or 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
<h1>Hello</h1> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<title>Test js-yaml</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.11.0/js-yaml.min.js"></script> | |
<script type="text/javascript"> | |
// YAML string to Javascript object |
This file contains hidden or 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 db { | |
var $host; | |
var $db_name; | |
var $username; | |
var $password; | |
var $res; | |
var $query; |
This file contains hidden or 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
An array, slice, or map composite literal of the form: | |
[]T{T{}, T{}} | |
will be simplified to: | |
[]T{{}, {}} | |
A slice expression of the form: | |
s[a:len(s)] | |
will be simplified to: | |
s[a:] |
This file contains hidden or 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
Verifying that "motyar.id" is my Blockstack ID. https://onename.com/motyar |
This file contains hidden or 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 | |
// Set $apiVersion, $apiSecret, $redirectUrl, and $scope etc here. | |
if($_GET['logout']!=""){ | |
session_destroy(); | |
exit("Logged out"); | |
} | |
if($_GET['code']!=""){ | |
$accessData = json_decode(file_get_contents("https://graph.facebook.com/".$apiVersion."/oauth/access_token?client_id=".$appId."&redirect_uri=".$redirectUrl."&client_secret=".$appSecret."&code=".trim($_GET['code'])),true); | |
$userInfo = json_decode(file_get_contents("https://graph.facebook.com/v2.7/me?fields=email,id,name&access_token=".$accessData['access_token']),true); | |
$_SESSION['access'] = $userInfo; |
This file contains hidden or 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 | |
header('Content-Type: application/x-www-form-urlencoded'); | |
$entityBody = file_get_contents('php://input'); | |
echo $entityBody; | |
// DO things with Slack API + $entityBody HERE! | |
?> |
This file contains hidden or 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
package main | |
import( | |
"flag" | |
"fmt" | |
"net/http" | |
"strings" | |
"io/ioutil" | |
"encoding/json" | |
"gopkg.in/mgo.v2/bson" |