Skip to content

Instantly share code, notes, and snippets.

View iketiunn's full-sized avatar

ike iketiunn

View GitHub Profile
@wal-f
wal-f / access-to-elementor-form-submissions.php
Last active March 11, 2025 14:15
A method to provide full management of form submissions to less-privileged WP roles.
<?php
/*
Plugin Name: Elementor form submission access
Description: Promotes the Elementor Pro form submissions page to top level, and bypasses the excessive and inflexible restrictions on access.
Version: 2.0.0
Author: Some netizen
Update URI: do-not-auto-update
*/
namespace Elementor\Core\Admin\Menu;
@giventofly
giventofly / timeago.js
Created April 21, 2021 00:15
javascript time ago
const timeAgo = (unixtime)=>{
//no weeks
const periods = ["second", "minute", "hour", "day", "month", "year", "decade"];
const lengths = ["60","60","24","31","12","10"];
//js returns in ms instead of s
const now = Math.round(Date.now() / 1000);
let difference = now - unixtime;
let j=0;
for(j = 0; difference >= lengths[j] && j < lengths.length-1; j++) {
difference = difference / lengths[j];
@its-dibo
its-dibo / google-cloud-shell.md
Last active August 1, 2022 01:36
customizing Google cloud shell

to customize Google cloud shell, modify on of the following files:

  • $HOME/.customize_environment
  • $HOME/.profile
  • $HOME/.bashrc

notes

  • .customize_environment runs once when google shell instance boots up,
  • .profile, .bashrc run once for each shell login, i.e: when a new shell opened they will run, use to customise the shell prompt or to add environments.
@giacomocerquone
giacomocerquone / adbCommands.txt
Last active April 29, 2025 02:15
Useful adb logcat commands when working with react native
// useful to debug js code errors
adb logcat "*:S" ReactNative:V ReactNativeJS:V
// useful to debug native errors (when the app won't even start)
adb logcat "*:E"
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active June 18, 2025 19:09
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@duluca
duluca / npm-scripts-for-docker.md
Last active August 19, 2024 09:22
npm scripts for Docker

These are generic npm scripts that you can copy & paste into your package.json file as-is and get access to convinience scripts to manage your Docker images all in one place.

How to Use

npm i -g mrm-task-npm-docker
npx mrm npm-docker

Contribute

Here's the code repository https://github.com/expertly-simple/mrm-task-npm-docker

@hmartiro
hmartiro / zeromq-vs-redis.md
Last active December 16, 2024 04:02
Comparison of ZeroMQ and Redis for a robot control platform

ZeroMQ vs Redis

This document is research for the selection of a communication platform for robot-net.

Goal

The purpose of this component is to enable rapid, reliable, and elegant communication between the various nodes of the network, including controllers, sensors, and actuators (robot drivers). It will act as the core of robot-net to create a standardized infrastructure for robot control.

Requirements:

@faisalman
faisalman / baseConverter.js
Last active January 11, 2023 14:43
Convert From/To Binary/Decimal/Hexadecimal in JavaScript
/**
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript
* https://gist.github.com/faisalman
*
* Copyright 2012-2015, Faisalman <[email protected]>
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
*/
(function(){
@kentbrew
kentbrew / node-on-ec2-port-80.md
Last active May 21, 2025 03:29
How I Got Node.js Talking on EC2's Port 80

The Problem

Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)

The temptingly easy but ultimately wrong solution:

Alter the port the script talks to from 8000 to 80:

}).listen(80);