Skip to content

Instantly share code, notes, and snippets.

View iocron's full-sized avatar

Sebastian P. iocron

View GitHub Profile
@inscapist
inscapist / flake-direnv.md
Last active August 9, 2024 17:24
Nix Flakes and Direnv on Mac OSX (Catalina)

Development environment with Nix Flakes and Direnv

This document is targeted at those who seek to build reproducible dev environment across machines, OS, and time.

It maybe easier for remote teams to work together and not spending hours each person setting up asdf/pyenv/rbenv, LSP servers, linters, runtime/libs. Nix is probably the closest thing to Docker in terms of development environment.

Flake is used here because it provides hermetic build, with absolutely no reliance on system environment (be it Arch/Catalina/Mojave). Also it freezes dependencies in flake.lock so builds are reproducible.

This gist provides the setup to develop Java/Clojure/Python applications on Nix. But it can be easily adapted to ruby, nodejs, haskell.

@froemken
froemken / testEmailServer.php
Last active June 16, 2025 15:20
Very simple PHP Script to test SMTP email server
<?php
// For port 24 host without scheme is just fine
// Add scheme, if using secure connection. Port 465 or 587
$host = 'ssl://smtp.strato.de';
//$host = 'tls://smtp.strato.de';
$port = 465;
//$port = 25;
$errorNumber;
$error;
$timeout = 10;

NodeJS + Plesk + nginx + HTTPS (wss://)

Connecting to a WebSocket server via WebSocket Secure connection (wss://) on a Plesk based host.

Create a subfolder or subdomain

As I'm going to have only one NodeJS, I prefer a subdomain: sockets.example.com If you will have several NodeJS Apps you may want something like example.com/socket1, example.com/socket2, ...

Optional: disable PHP

As I will only use NodeJS on that subdomain, and I will redirect all traffic to NodeJS, it is safe to disable PHP

@jcmartinezdev
jcmartinezdev / erc20-token-sample.sol
Last active August 15, 2025 17:50
Necessary code to generate an ERC20 Token
pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// Sample token contract
//
// Symbol : LCST
// Name : LCS Token
// Total supply : 100000
// Decimals : 2
// Owner Account : 0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe
@yoyosan
yoyosan / cleancrap.md
Last active August 31, 2025 22:21
How to clean kdetmpdevfsi or .ICEd-unix suspicious files/folders or processes

Problem

I've recently been hacked on my VPS(using Centos 7.6 and CWP up to date) and the following files/folders were created:

  • /tmp/.ICEd-unix
  • /var/tmp/.ICEd-unix
  • /tmp/kdevtmpfsi
  • /var/tmp/kinsing

The following processes were running and using 100% CPU and Memory:

/*
It's now a package. You can find it here:
https://github.com/joshnuss/svelte-local-storage-store
*/
// Svelte store backed by window.localStorage
// Persists store's data locally
@Baldinof
Baldinof / .dockerignore
Last active June 28, 2025 21:10
Single PHP FPM container with Caddy
/vendor
/docker
/Dockerfile
@paulredmond
paulredmond / docker.conf
Last active May 6, 2024 15:38
Example www pool for PHP-FPM with dynamic Environment variables
; if you're using the starter bundle file `docker/php/php-fpm.d/docker.conf`
[global]
daemonize = no
pid = run/php-fpm.pid
[www]
listen = /usr/local/var/run/php-fpm.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
@iocron
iocron / index.html
Created May 20, 2019 23:27
CSS Triangle Overlay // source https://jsbin.com/vijozob
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CSS Triangle Overlay - Compatible with IE9+,FF,Chrome,Safari">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>CSS Triangle Overlay</title>
<style id="jsbin-css">
*{ margin:0; }
body { background:#eee; }
@mikowl
mikowl / oneliners.js
Last active September 24, 2025 19:23
👑 Awesome one-liners you might find useful while coding.
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// or
const sleep = util.promisify(setTimeout);