Skip to content

Instantly share code, notes, and snippets.

View ndaifallah's full-sized avatar
🤧

Nasreddine ndaifallah

🤧
View GitHub Profile
@fritsstegmann
fritsstegmann / Setup Redis 6 with TLS on Ubuntu 18.04.md
Last active January 26, 2025 18:28
Setup Redis 6 with TLS
On Ubuntu 18.04
@phuysmans
phuysmans / gist:4f67a7fa1b0c6809a86f014694ac6c3a
Created January 8, 2018 09:29
docker compose health check example
version: '2.1'
services:
php:
tty: true
build:
context: .
dockerfile: tests/Docker/Dockerfile-PHP
args:
version: cli
volumes:
@yllus
yllus / admin-ajax.php
Last active December 4, 2023 11:21
An optimized admin-ajax.php that executes visitor-only AJAX requests in WordPress
<?php
// Note: This file exists as a near-copy of /wp-admin/admin-ajax.php so that caching on this URL can occur.
/**
* WordPress AJAX Process Execution.
*
* @package WordPress
* @subpackage Administration
*
* @link https://codex.wordpress.org/AJAX_in_Plugins
@tuxfight3r
tuxfight3r / s3_upload.sh
Last active July 3, 2025 14:23
AWS - Upload files to S3 via curl
#!/bin/bash -x
#Date: 21/7/2017
#Author: Mohan
#Purpose: To upload files to AWS S3 via Curl
#Uploads file at the top level folder by default
#S3 parameters
S3KEY="XXXXXXXXXXX"
S3SECRET="XXXXXXXXXXXXXXXX"
@CowboyJim
CowboyJim / start_bc_network.py
Last active April 2, 2018 17:50
Create and start Ethereum blockchain network
#!/usr/bin/env python
"""
Simple script that creates a four node Ethereum private blockchain
network using the geth client. Please adjust the script constants
to match your environment.
"""
import sys
from subprocess import call
import os.path
import time
@yoki
yoki / 00_pandas.py
Last active August 8, 2025 17:12
Pandas tutorial
# 10_generation
# 11_filter
# 12_setting_value
# 13_io
# 15_groupby
# 16_merge
# 17_pivot_reshape
# 18_misc
# 19_type
# 21_category
@mihow
mihow / load_dotenv.sh
Last active March 6, 2026 10:58
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@andybangs
andybangs / Settings.js
Created January 13, 2017 19:34
Example Component
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import {
ActionSheetIOS,
ActivityIndicator,
Keyboard,
LayoutAnimation,
NativeModules,
StyleSheet,
@olivertappin
olivertappin / create-large-file.sh
Last active May 29, 2025 22:47
Create a large file for testing
# Please note, the commands below will create unreadable files and should be
# used for testing file size only. If you're looking for something that has
# lines in it, use /dev/urandom instead of /dev/zero. You'll then be able to
# read the number of lines in that file using `wc -l large-file.1mb.txt`
# Create a 1MB file
dd if=/dev/zero of=large-file-1mb.txt count=1024 bs=1024
# Create a 10MB file
dd if=/dev/zero of=large-file-10mb.txt count=1024 bs=10240
@MPJHorner
MPJHorner / Ubuntu16SwapFile
Created September 5, 2016 17:10
Create Swap File on Ubuntu 16.04
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo swapon --show