Skip to content

Instantly share code, notes, and snippets.

@pantchox
pantchox / esp32_aes_example.c
Created February 18, 2022 01:39 — forked from cnlohr/esp32_aes_example.c
Example of using hardware AES 256 Crypto in CBC mode on the ESP32 using ESP-IDF
#include <string.h>
#include <stdio.h>
#include <hwcrypto/aes.h>
/*
For Encryption time: 1802.40us (9.09 MB/s) at 16kB blocks.
*/
static inline int32_t _getCycleCount(void) {
int32_t ccount;
@pantchox
pantchox / gist:f261219fc4ee394671cd64dbebb05846
Created May 15, 2019 15:13 — forked from pavelbinar/gist:6333285
JavaScript: Random Boolean
/* Random Boolean */
var randomNumber = Math.random() >= 0.5;
console.log(randomNumber);
@pantchox
pantchox / topkeywords.js
Created November 8, 2017 19:19 — forked from elliotbonneville/topkeywords.js
Find top keywords associated with a Google search with this Node.js application.
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
@pantchox
pantchox / Router.js
Created October 4, 2017 20:59 — forked from vitalipe/Router.js
the-only-router-I-ever-needed
const _ = require("lodash");
const Navigo = require("navigo");
class Router {
constructor(routes, config) {
let handler = config.handler || (() => null);
let before = config.before || ((d) => d());
let router = new Navigo(null, true);
_(routes).each(
@pantchox
pantchox / repo-reset.md
Created September 19, 2017 11:44 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pantchox
pantchox / zoneedit
Last active January 2, 2017 00:34
zoneedit update ip 1 liner
# put this in crontab or bash (yes zoneedit now has token in your account per domain!)
# note make 600 seconds intervals else you will be block
curl --user <User>:<TOKEN> https://dynamic.zoneedit.com/auth/dynamic.html?host=my.hostname.com