Skip to content

Instantly share code, notes, and snippets.

View frnck37's full-sized avatar
😃

frnck37 frnck37

😃
View GitHub Profile
@maxim75
maxim75 / gist:1037392
Created June 21, 2011 07:23
Accessing wikipedia api with JavaScript
<!DOCTYPE html>
<html>
<head>
<style>
</style>
<!-- JQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js">
</script>
@bazub
bazub / stars.php
Created November 7, 2012 14:46
Star rating system using PHP/HTML/CSS
<html>
<style type="text/css">
.starRate {position:relative; margin:20px; overflow:hidden; zoom:1;}
.starRate ul {width:160px; margin:0; padding:0;}
.starRate li {display:inline; list-style:none;}
.starRate a, .starRate b {background:url(star_rate.gif) left top repeat-x;}
.starRate a {float:right; margin:0 80px 0 -144px; width:80px; height:16px; background-position:left 16px; color:#000; text-decoration:none;}
.starRate a:hover {background-position:left -32px;}
.starRate b {position:absolute; z-index:-1; width:80px; height:16px; background-position:left -16px;}
.starRate div b {left:0px; bottom:0px; background-position:left top;}
@BilalBudhani
BilalBudhani / rssToJson
Created January 31, 2013 10:04
PHP function to convert simple RSS to JSON
public function Parse ($url) {
$fileContents= file_get_contents($url);
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
$simpleXml = simplexml_load_string($fileContents);
$json = json_encode($simpleXml);
return $json;
}
var net = require('net');
var phpjs = require('phpjs');
var mysql = require('mysql');
var server = net.createServer(function(c) {
c.setEncoding('ascii');
var sqlconn = mysql.createConnection({
host: 'localhost',
user: '[somedbuser]',
@mgrubinger
mgrubinger / PHPMapTileDownloader.php
Last active July 30, 2021 22:30
PHPMapTileDownloader: Simple PHP script to download map tiles from a tileserver (e.g. to create offline leaflet maps). Disclaimer: make sure the tile provider allows bulk downloading!
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>PHPMapTileDownloader</title>
<style>
body {
font-family: 'Helvetica', sans-serif;
text-align: center;
margin-top: 20px;
@pim-borst
pim-borst / AsyncSDServer.ino
Last active June 10, 2023 03:09
Serve files from an SD-card using Me No Dev's async webserver for the ESP8266.
/*
* Example how to serve files from an SD-card using Me No Dev's async webserver for the ESP8266.
* See https://github.com/me-no-dev/ESPAsyncWebServer
*
* Basically I copied the code for serving static files from SPIFFS and modified it for the SD library.
* To resolve conflicts between SPIFFS and SD File classes I had to include the sd namespace in SD.h and SD.cpp in packages/esp8266/hardware/esp8266/2.3.0/libraries/SD/src.
* So in SD.h put "namespace sd { ... }; using namespace sd;" around everything excluding the # preprocessor directives.
* And in SD.cpp put "namespace sd { ... };" around everything excluding the # preprocessor directives.
*
* Also, don't forget to fill in your WiFi SSID and password and put an index.htm file on your SD card.