Skip to content

Instantly share code, notes, and snippets.

View KeithNdhlovu's full-sized avatar

Keith Ndhlovu KeithNdhlovu

View GitHub Profile
@pyzenberg
pyzenberg / main.dart
Created September 4, 2019 13:38
Flutter WebSocket autoconnection
import 'dart:io';
import 'dart:async';
import 'package:flutter/material.dart';
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@gaearon
gaearon / index.html
Last active April 1, 2025 01:48
Add React in One Minute
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@AVGP
AVGP / wat.js
Created September 6, 2017 22:17
ffmpeg.js converting webm from a media recorder into mp4
var ffmpeg = require('ffmpeg.js/ffmpeg-mp4.js')
document.querySelector('button').addEventListener('click', (evt) => {
document.querySelector('[camera]').setAttribute('animation', {
property: 'rotation',
to: '0 360 0',
dur: 10000,
easing: 'linear'
})
@nguyenanhtu
nguyenanhtu / SSLXampp.md
Last active July 12, 2024 19:06
Guide to configure SSL in XAMPP for Windows

How to test 'https' in XAMPP for localhost ? I will guide you

Menu

  • Create certificate
  • Config Apache to access https instead of http
  • Config mod rewrite to generate SSL url
  • Config Virtual host to test site

Step 1 : Create certificate

  • Go to your XAMPP installation directory (in my case it’s E:\xampp), figure out apache folder. In this, find & run batch file
@CodeMyUI
CodeMyUI / index.html
Created October 28, 2016 08:13
THREE Text Animation #1
<script>
THREE.ShapeUtils.triangulateShape = (function () {
var pnlTriangulator = new PNLTRI.Triangulator();
return function triangulateShape(contour, holes) {
return pnlTriangulator.triangulate_polygon([contour].concat(holes));
};
})();
</script>
<div id="three-container"></div>
@CodeMyUI
CodeMyUI / index.html
Created October 28, 2016 05:42
THREE Image Transition
<div id="three-container"></div>
<div id="instructions">
click and drag to control the animation
</div>
@astein
astein / html5_ima_sdk_example.js
Last active November 14, 2024 05:56
Example of using Google IMA SDK for HTML5
// video DOM inside creative
//<div id="videoContainer">
// <video id="videoContainer"></video>
//</div>
// load IMA SDK at init load time
$.getScript('//imasdk.googleapis.com/js/sdkloader/ima3.js');
// usage: startVideo( /* vast tag url */ );
@koistya
koistya / App.js
Last active June 8, 2022 09:55
How to add `onscroll` event in ReactJS component
import React from 'react';
let lastScrollY = 0;
let ticking = false;
class App extends React.Component {
componentDidMount() {
window.addEventListener('scroll', this.handleScroll, true);
}
@Lukasa
Lukasa / example.py
Created March 31, 2013 16:28
Requests and Beautiful Soup example, following the form of http://bpaste.net/show/kMetvCdrfnzh5RgiUKU4/
from BeautifulSoup import BeautifulSoup
import requests
import urlparse
URL = 'example.com'
s = requests.Session()
def fetch(url, data=None):
if data is None:
return s.get(url).content
@tdreyno
tdreyno / airports.json
Created December 13, 2012 18:50
JSON data for airports and their locations
This file has been truncated, but you can view the full file.
[
{
"code": "AAA",
"lat": "-17.3595",
"lon": "-145.494",
"name": "Anaa Airport",
"city": "Anaa",
"state": "Tuamotu-Gambier",
"country": "French Polynesia",