Skip to content

Instantly share code, notes, and snippets.

@batazo
batazo / A vintage-analog-tv.markdown
Last active September 1, 2021 22:22
Vintage Analog TV

Vintage Analog TV

A (somewhat) functional black-and-white TV from the early 20th century.

A Pen by Bzozoo on CodePen.

License.

@odan
odan / Slim 4 Tutorial.md
Last active January 15, 2022 11:22
Slim 4 Tutorial
@Rowadz
Rowadz / monitoring_binary_logs.js
Created September 26, 2019 01:08
Monitoring binary logs via Nodejs
const mysql = require('mysql');
const MySQLEvents = require('@rodrigogs/mysql-events');
const ora = require('ora'); // cool spinner
const spinner = ora({
text: '🛸 Waiting for database events... 🛸',
color: 'blue',
spinner: 'dots2'
});
const program = async () => {
// TodoPage.js
export const TodoContext = createContext({});
class TodoPage extends React.Component {
state = {
todos: [
{ id: 1, desc: 'Check email', completed: false },
{ id: 2, desc: 'Write blog post', completed: false },
],
user: { name: 'John', canDelete: true },
@cn0047
cn0047 / websockets.php
Last active June 20, 2023 23:17
Super simple PHP WebSocket example - websockets.php
<?php
$address = '0.0.0.0';
$port = 12345;
// Create WebSocket.
$server = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($server, SOL_SOCKET, SO_REUSEADDR, 1);
socket_bind($server, $address, $port);
socket_listen($server);
@cn0047
cn0047 / websockets.html
Created August 2, 2018 23:10
Super simple PHP WebSocket example - websockets.html
<html>
<body>
<div id="root"></div>
<script>
var host = 'ws://0.0.0.0:12345/websockets.php';
var socket = new WebSocket(host);
socket.onmessage = function(e) {
document.getElementById('root').innerHTML = e.data;
};
</script>
@miroslavradojevic
miroslavradojevic / createXml.js
Created March 9, 2018 12:02
Create XML in JavaScript
var xmlDoc = document.implementation.createDocument(null, "devices");
var elements = xmlDoc.getElementsByTagName("devices");
var node = xmlDoc.createElement("DeviceA"); // do not use the methods provided by the document namespace
node.setAttribute('ID', 1000);
node.setAttribute('DESCRIPTION', 'NameA');
elements[0].appendChild(node); // add the element
var node = xmlDoc.createElement("DeviceB");
node.setAttribute('ID', 2000);
@serjKim
serjKim / gist:7f453992211637731d2f4d762c60f7a5
Last active July 6, 2022 21:43
integrate expo to the existing project
  1. add app.json, set the newest sdkVersion
{
  "name": "<yourname>",
  "displayName": "<yourname>",
  "expo": {
    "sdkVersion": "25.0.0"
  }
}
@MuhammadFaizanKhan
MuhammadFaizanKhan / PDOFunctionsDemo.php
Last active April 30, 2023 22:35
Insert, Update, Delete and Select with PHP, PDO and MySQL
<?php
/**
* Created by PhpStorm. * User: Faizan Khan * Date: 1/2/2018 * Time: 10:51 AM
*/
/*Script Motive: The purpose of the file is to present different PDO Functions for DML and DDL operations
Sample Table
Table Name: UserTbl
Columns: Id, UserName, Email, RecordAddDate
*/
@derick-montague
derick-montague / sync-github-to-bitbucket.md
Last active April 20, 2025 02:16
Sync github repo to bitbucket repo

Set up remotes

setup local repo

mkdir myrepository
cd myrepository
git init

add bitbucket remote as "origin"