Skip to content

Instantly share code, notes, and snippets.

View nNabakhteveli's full-sized avatar
:electron:

Nika Nabakhteveli nNabakhteveli

:electron:
View GitHub Profile
@tyanyaw
tyanyaw / clean-docker-for-mac.sh
Created September 2, 2023 10:20
Cleaning Docker.raw on Mac OS
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated 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, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active September 23, 2024 01:17
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@eugeneglova
eugeneglova / index.js
Last active April 25, 2021 20:55
Fill array with missing values using recursion
// [1,3,8,9,17] -> [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ]
// Using recursion
var dates = [1,3,8,9,17];
function nextI (i) {return i+1;}
function getMissingElements(nextI, element, currentNextElement) {
var nextElement = nextI(element);
if (nextElement === currentNextElement) {
return [];
}
return [nextElement].concat(getMissingElements(nextI, nextElement, currentNextElement));
@briceburg
briceburg / Dockerfile.fails
Created March 30, 2016 22:17
docker - example adding www-data user to alpine images
FROM nginx:alpine
# stock verison from php:alpine image
# ensure www-data user exists
RUN set -x \
&& addgroup -g 82 -S www-data \
&& adduser -u 82 -D -S -G www-data www-data
# 82 is the standard uid/gid for "www-data" in Alpine
# http://git.alpinelinux.org/cgit/aports/tree/main/apache2/apache2.pre-install?h=v3.3.2