Skip to content

Instantly share code, notes, and snippets.

@diversen
diversen / backup-wordpress-single-file.sh
Last active Jul 5, 2021
Single file wordpress backup script using rsync and mysqldump
View backup-wordpress-single-file.sh
#!/usr/bin/env php
<?php
/**
* Wordpress backup without any configuration
*
* USAGE:
*
* ./wordpress-backup.php path/to/basepath/of/wordpress/
*
@KrzysztofPrzygoda
KrzysztofPrzygoda / htpasswd.php
Last active Sep 19, 2022
A simple PHP .htpasswd and .htaccess generator
View htpasswd.php
<pre>
<?php
/**
* A simple PHP .htpasswd and .htaccess generator
* If already present, .htpasswd is overwrittern but .htaccess is prepended with Access clousure if not found
*
* @author Krzysztof Przygoda, 2018
* @version 1.0
*/
@eneko
eneko / list-of-curl-options.txt
Last active Sep 27, 2022
List of `curl` options
View list-of-curl-options.txt
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
@agrcrobles
agrcrobles / android_instructions_29.md
Last active Aug 22, 2022 — forked from patrickhammond/android_instructions.md
Setup Android SDK on OSX with and without the android studio
View android_instructions_29.md

Hi, I am a fork from https://gist.github.com/patrickhammond/4ddbe49a67e5eb1b9c03.

A high level overview for what I need to do to get most of an Android environment setup and maintained on OSX higher Catalina and Big Sur with and without Android Studio been installed.

Considering the SDK is installed under /Users/<your_user>/Library/Android/sdk folder which is the Android Studio preferred SDK location, but it works fine under /usr/local/share/android-sdk as well, which is a location pretty much used on CI mostly.

Prerequisites:

https://github.com/shyiko/jabba instead ?

@diversen
diversen / phar-composer-usage-example.md
Last active Dec 31, 2016
notes about phar-composer
View phar-composer-usage-example.md

phar-composer example

Create a composer dir called pgit

Create a composer.json file inside this dir containing:

{
    "require": {
 "diversen/minimal-cli-framework": "^1.1"
@soska
soska / index.html
Created Dec 29, 2016 — forked from anonymous/index.html
Musical Chord Progression Arpeggiator
View index.html
<article>
<aside id="aside"></aside>
<main id="main"></main>
</article>
anonymous
anonymous / index.html
Created Dec 29, 2016
Musical Chord Progression Arpeggiator
View index.html
<article>
<aside id="aside"></aside>
<main id="main"></main>
</article>
View test-php-basic-auth.php
<?php
function require_auth() {
$AUTH_USER = 'admin';
$AUTH_PASS = 'admin';
header('Cache-Control: no-cache, must-revalidate, max-age=0');
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW']));
$is_not_authenticated = (
!$has_supplied_credentials ||
$_SERVER['PHP_AUTH_USER'] != $AUTH_USER ||
$_SERVER['PHP_AUTH_PW'] != $AUTH_PASS
@cburgdorf
cburgdorf / xor_keras.py
Last active Nov 18, 2020
Comparing XOR between tensorflow and keras
View xor_keras.py
import numpy as np
from keras.models import Sequential
from keras.layers.core import Activation, Dense
training_data = np.array([[0,0],[0,1],[1,0],[1,1]], "float32")
target_data = np.array([[0],[1],[1],[0]], "float32")
model = Sequential()
model.add(Dense(32, input_dim=2, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
@rajeevkannav
rajeevkannav / pdf2htmlEX.sh
Last active Mar 29, 2022
Install CMake, pkg-config,GNU Getopt,GCC,poppler,fontforge,pdf2htmlEX in Ubuntu 15.05
View pdf2htmlEX.sh
#!/bin/bash
# Ubuntu Developer Script For pdf2htmlEx
# Created by Rajeev Kannav Sharma
# http://rajeevkannav.github.io/
#
#
# Downloads and configures the following:
#
# CMake, pkg-config
# GNU Getopt