Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<script src="pingpoliCandlestickChart.js"></script>
</head>
<body>
<canvas width="1280" height="720" id="testcanvas"></canvas>
<script>
function plot()
{
var xmlhttp = new XMLHttpRequest();
/*
A single-file JavaScript class to draw candlestick charts.
Use at your own risk.
https://twitter.com/pingpoli
https://pingpoli.de
*/
function pingpoliCandlestick( timestamp , open , close , high , low )
{
this.timestamp = parseInt(timestamp);
this.open = parseFloat(open);
#include <iostream>
#include "../../SRC/lstd/filesystemutil.hpp"
#include "../../SRC/lstd/Timer.hpp"
class Node
{
public:
Node* parent;
std::string value;
std::vector< Node* > children;
<?php
// based on https://stackoverflow.com/questions/12684765/twitter-api-returns-error-215-bad-authentication-data
require_once( "mysql_config.php" );
define( 'ACCESS_TOKEN' , 'YOUR_ACCESS_TOKEN' );
define( 'ACCESS_TOKEN_SECRET' , 'YOUR_ACCESS_TOKEN_SECRET' );
define( 'CONSUMER_KEY' , 'YOUR_CONSUMER_KEY' );
define( 'CONSUMER_KEY_SECRET' , 'YOUR_CONSUMER_KEY_SECRET' );
// get the follower ids
<?php
// based on https://stackoverflow.com/questions/12684765/twitter-api-returns-error-215-bad-authentication-data
define( 'ACCESS_TOKEN' , 'YOUR_ACCESS_TOKEN' );
define( 'ACCESS_TOKEN_SECRET' , 'YOUR_ACCESS_TOKEN_SECRET' );
define( 'CONSUMER_KEY' , 'YOUR_CONSUMER_KEY' );
define( 'CONSUMER_KEY_SECRET' , 'YOUR_CONSUMER_KEY_SECRET' );
// get the twitter ids of all followers of your account
$query = array(
'screen_name' => 'YOUR_TWITTER_USERNAME',
// by default, personalized ads are turned off
var CCM_showPersonalizedAds = false;
// increase this number when your cookie policy has changed, this will show the popup to all users again
var CCM_versionNumber = 0;
var CCM_popup;
// helper function to get the value of a cookie
function CCM_getCookie( name )
// by default, personalized ads are turned off
var CCM_showPersonalizedAds = false;
// increase this number when your cookie policy has changed, this will show the popup to all users again
var CCM_versionNumber = 0;
function CCM_getCookieConsent( forceShow )
{
var consent = CCM_getCookie( "ccm_accepted_v"+CCM_versionNumber );
if ( consent != "yes" || forceShow )
{
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
if ( !CCM_showPersonalizedAds ) (adsbygoogle=window.adsbygoogle||[]).requestNonPersonalizedAds=1;
// only show ads after you requested non personalized ads
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<script src="js/CookieConsentManager.js"></script>
<script>CCM_getCookieConsent();</script>
@pingpoli
pingpoli / vec3.hpp
Last active September 9, 2020 20:21
class vec3
{
public:
float x;
float y;
float z;
vec3( const float x = 0 , const float y = 0 , const float z = 0 ) : x(x) , y(y) , z(z) {}
// add another vector to a vector like a += v;