Skip to content

Instantly share code, notes, and snippets.

<h1>Hello {{ name }}!</h1>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
<?php
require_once __DIR__.'/silex.phar';
$app = new Silex\Application();
$app->post('/', function() use($app) {
return 'Hello world!';
});
<?php
function swap_access_token_for_page($access_token, $page_id)
{
$accounts = file_get_contents('https://graph.facebook.com/me/accounts?access_token='.$access_token);
$accounts = json_decode($accounts, true);
if (isset($accounts['data'])) {
foreach ($accounts['data'] as $account) {
if ($page_id == $account['id']) {
$ edit index.php (paste the code from above)
$ git clone git://github.com/facebook/php-sdk.git
$ git clone git://github.com/caefer/FB.Permission.git
<?php
$APP_ID = 'YOUR_APP_ID';
$APP_SECRET = 'YOUR_APP_SECRET';
?>
<html lang="en">
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
</head>
<html lang="en">
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
</head>
<body>
<color value="red"><shape value="round"><size value="large">
<div class="thing">
<h3>Sun</h3>
</div>
function filter(attribute, value)
{
$('.thing .'+attribute+'.'+value).hide();
}
function unfilter(attribute, value)
{
$('.thing .'+attribute+'.'+value).show();
}
<div class="thing">
<div class="color red">
<div class="size large">
<div class="shape round">
<strong>Sun</strong> color: red, size: large, shape: round
</div>
</div>
</div>
</div>
<div class="thing">
<div class="thing">
<strong>Sun</strong> color: red, size: large, shape: round
</div>
<div class="thing">
<strong>Moon</strong> color: lightgrey, size: medium, shape: round
</div>
...