Skip to content

Instantly share code, notes, and snippets.

View loicnestler's full-sized avatar
🏠
Working from home

Loïc loicnestler

🏠
Working from home
View GitHub Profile
@loicnestler
loicnestler / check-mailserver-for-openrelay.txt
Created February 7, 2021 19:11
Check mail server for OpenRelay
# Stolen from https://github.com/Mailu/Mailu/issues/1370#issuecomment-592447023
# $YOUR_PUBLIC_SERVER_IP = your mail server IP
# $YOUR_PUBLIC_SERVER_DOMAIN = your mail server domain (mail.example.org)
# $A_MAIL_NOT_MANAGED_BY_YOUR_SERVER = some mail address that is not managed by your mail server (for example a @gmail address)
$ nc -v $YOUR_PUBLIC_SERVER_IP
Ncat: Version 7.80 ( https://nmap.org/ncat )
Ncat: Connected to $YOUR_PUBLIC_SERVER_IP:25.
220 $YOUR_MAIL_SERVER_DOMAIN ESMTP ready
HELO $YOUR_MAIL_SERVER_DOMAIN
@98lenvi
98lenvi / Create website in darkweb.md
Last active July 2, 2024 14:26
steps to host dark web website

Create your own site in the dark web.

There is a lot of misconception around the dark web, and most of the people think that it is not possible to create their own website on Dark web (The Onion network). Today we will set up a website in the Onion/Tor network for free.

Screenshot of my dark website

As you can see above, I have created my own website in the Tor network, and I've accessed it using the Tor Browser.

This tutorial consists of three steps

@arcdev1
arcdev1 / use-ck-editor.js
Last active March 10, 2023 16:33
A custom React Hook for using CKEditor with SSR particularly with NextJS. https://ckeditor.com | https://nextjs.org
// A custom React Hook for using CKEditor with SSR
// particularly with NextJS.
// https://ckeditor.com | https://nextjs.org
import React, { useRef, useState, useEffect } from 'react'
export default function useCKEditor () {
const editorRef = useRef()
const [isEditorLoaded, setIsEditorLoaded] = useState(false)
const { CKEditor, InlineEditor } = editorRef.current || {}
@bakura10
bakura10 / microdata-schema.liquid
Last active July 16, 2024 08:56
This is the last microdata-schema for our Shopify themes
{%- comment -%}
This snippet structures the micro-data using JSON-LD specification. Please note that for Product especially,
the schema often changes. We try to output as much info as possible, but Google may add new requirements over time,
or change the format of some info
LAST UPDATE: May 10th 2023 (we added the "hasMerchantReturnPolicy" and "shippingDetails" to include the shipping and
return policy if they have been specified as store policies).
{%- endcomment -%}
{%- if request.page_type == 'product' -%}
@hakobe
hakobe / client.go
Created September 23, 2016 16:33
golang unix domain socket
package main
import (
"io"
"log"
"net"
"time"
)
func reader(r io.Reader) {
@estrattonbailey
estrattonbailey / address-form.liquid
Created August 29, 2016 18:20
Shopify Address Form
<div id="{{form_outer_id}}" class="address__form relative w1 {{form_classes}}" style="display: none;">
{% form 'customer_address', form_action %}
{% assign form_id = form.id %}
{% capture form_script %}{% if form_id == 'new' %}barrel.toggleNewForm(event){% else %}barrel.toggleForm(event, {{form_id}}){% endif %}{% endcapture %}
{% capture form_suffix %}{% if form_id and form_id != 'new' %}_{{form_id}}{% endif %}{% endcapture %}
{% capture form_city_id %}{% if form_id == 'new' %}AddressCityNew{% else %}AddressCity{% endif %}{% endcapture%}
{% capture form_country_id %}{% if form_id == 'new' %}AddressCountryNew{% else %}AddressCountry{% endif %}{% endcapture%}

Templating engines and React.js

I want to make a shopify theme using react.

How shopify theming works

You have a bunch of template files that have access to global server-side variables with liquid e.g. {{ product.title }}. Think wordpress or any other theme-based system.

 /theme
@reiki4040
reiki4040 / signal.go
Created October 2, 2014 14:38
signal handling example for golang
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
@graphicbeacon
graphicbeacon / chat-server.js
Last active October 10, 2023 16:37
A simple TCP chat server with NodeJS, based on the example provided by creationix.
var net = require('net');
var sockets = [];
var port = 8000;
var guestId = 0;
var server = net.createServer(function(socket) {
// Increment
guestId++;
socket.nickname = "Guest" + guestId;
@JalfResi
JalfResi / revprox.go
Last active July 26, 2024 15:18
Simple reverse proxy in Go
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {