Skip to content

Instantly share code, notes, and snippets.

@renowncoder
renowncoder / mysq-mariadb-macos-start-issue.md
Created November 2, 2021 05:16 — forked from irazasyed/mysq-mariadb-macos-start-issue.md
Solution for MySQL / MariaDB Start Issue on MacOS

Solution for MySQL / MariaDB Start Issue on MacOS

Errors

On trying to start mysql.server start

./usr/local/bin/mysql.server: line 264: kill: (12262) - No such process ERROR!

@renowncoder
renowncoder / auth.php
Created October 29, 2021 23:57 — forked from cubehouse/auth.php
eJabberd Auth.php for WordPress authentication
#!/usr/bin/php
<?php
/*
Copyright (c) <2005> LISSY Alexandre, "lissyx" <alexandrelissy@free.fr>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software andassociated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
@renowncoder
renowncoder / push.patch
Created October 29, 2021 17:12 — forked from tmolitor-stud-tu/push.patch
Minimal patch for conversations to use mod_push_appserver as appserver backend
diff --git a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java
index 234ddc3b..07f373f1 100644
--- a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java
+++ b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java
@@ -393,11 +393,12 @@ public class IqGenerator extends AbstractGenerator {
IqPacket packet = new IqPacket(IqPacket.TYPE.SET);
packet.setTo(appServer);
Element command = packet.addChild("command", "http://jabber.org/protocol/commands");
- command.setAttribute("node", "register-push-gcm");
+ command.setAttribute("node", "v1-register-push");
@renowncoder
renowncoder / room.ejs
Created October 23, 2021 21:23 — forked from LiorB-D/room.ejs
Video Chat - room.ejs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Set the ROOM_ID variable to the roomId that is passed in by server.js -->
<script>
const ROOM_ID = "<%= roomId %>"
</script>
<!-- CDN in the peerJS and socket.io libraries -->
@renowncoder
renowncoder / Readme.md
Created October 22, 2021 23:03 — forked from ChuckJHardy/Readme.md
ZeroMQ + Node.js + Socket.io + UI for sending message from Ruby to a Javascript UI running on Node.js

Install the following requirements:

brew info zeromq
npm install zmq
npm install socket.io
gem install ffi-rzmq

Within the app directory run the following commands in different panes.

ruby worker.rb

@renowncoder
renowncoder / installer-2.php
Created October 15, 2021 01:51 — forked from igorbenic/installer-2.php
Working with Custom Tables in WordPress – Installing and Updating | https://ibenic.com
<?php
/**
* Installer class
*/
namespace MyPlugin;
class Installer {
// ... previous code
@renowncoder
renowncoder / instructions.md
Created October 15, 2021 01:11 — forked from gesteves/instructions.md
Ad loading & analytics exercise

Ad Loading & Analytics Tracker

Hello, and welcome to the technical portion of your interview. Try to complete as much of this exercise as you can before our call, and feel free to use any editors, tools, frameworks, libraries or resources you wish (be prepared to explain why you're using them, though!). We're not looking for a perfect, or even complete, solution; the idea is to have a conversation about how you approached the problem and walk us through your implementation, so please work in whatever environment you feel comfortable using.

The exercise consists in writing a JavaScript system that:

  • Lazy-loads each ad as its container enters the viewport, and
  • Reports stats about the user's visit back to the server
# First, install all of the things
sudo su
apt-get update
apt-get install nginx
/etc/init.d/nginx start
apt-get install python-dev
apt-get install python-pip
apt-get install libjpeg-dev libpng-dev libtiff-dev libjasper-dev libgtk2.0-dev python-numpy python-pycurl libwebp-dev python-opencv libjpeg-progs
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
# First, install all of the things
apt-get update
apt-get install nginx
/etc/init.d/nginx start
apt-get install python-dev
apt-get install python-pip
apt-get install libjpeg-dev libpng-dev libtiff-dev libjasper-dev libgtk2.0-dev python-numpy python-pycurl libwebp-dev python-opencv libjpeg-progs
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
pip install pillow
<?php
namespace PublicFunctionOrg/WordPress/ReadingTime;
add_filter('posts_where', function($where, $wp_query){
$readingTime = $wp_query->get("reading_time", false);
if(is_array($readingTime) && isset($readingTime["compare"]) && isset($readingTime["value"]) ){
$db = new Database();
$value = intval($readingTime["value"]);
$compare = $readingTime["compare"]; // should be sanitized