This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/ | |
| # Adapted to work with the official image available into Mac App Store | |
| # | |
| # Enjoy! | |
| hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app | |
| hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J | |
| hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install Docker on Xenial 16.04.1 x64 | |
| # Ref https://docs.docker.com/engine/installation/linux/ubuntulinux/ | |
| # No interactive for now. | |
| export DEBIAN_FRONTEND=noninteractive | |
| # Update your APT package index. | |
| sudo apt-get -y update | |
| # Update package information, ensure that APT works with the https method, and that CA certificates are installed. | |
| sudo apt-get -y install apt-transport-https ca-certificates | |
| # Add the new GPG key. | |
| sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # put this in the same folder as the script | |
| RewriteEngine On | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| # edit "wpoison" and "members" to your liking, don't forget to change the wpoison.php filename if you modified it | |
| # make sure the "wpoison" regex matches the "wpoison".php filename. | |
| #RewriteRule wpoison$ /members/wpoison.php | |
| #RewriteRule wpoison/(.*)$ /members/wpoison.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export _ps1_timer | |
| function _ps1_timer_start { | |
| # echo START | |
| _ps1_timer=${_ps1_timer:-`gdate +%s%N 2> /dev/null || date +%s%N`}; | |
| } | |
| function _ps1_timer_stop { | |
| # echo STOP | |
| if [ -z "$_ps1_timer" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| // A minimal polyfill for copying text to clipboard that works most of the time in most capable browsers. | |
| // Note that: | |
| // - You may not need this. `navigator.clipboard.writeText()` works directly in all modern browsers as of 2020. | |
| // - In Edge, this may call `resolve()` even if copying failed. | |
| // - In Safari, this may fail if there is nothing selected on the page. | |
| // See https://github.com/lgarron/clipboard-polyfill for a more robust solution. | |
| // | |
| // License for this Gist: public domain / Unlicense | |
| function writeText(str) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env node | |
| /** | |
| Demostrate a practical use case with Bluebird promise api. | |
| Read a line delimited file and store into sqlite3 db. | |
| Promise.promisifyAll - Converting synchromous api's to Async. | |
| Promise.using and Promise.disposer - Resource managment. | |
| Promise.map and Promise.spread - Leveraging arrays in promises. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($) { | |
| $(function() { | |
| var isoCountries = [ | |
| { id: 'AF', text: 'Afghanistan'}, | |
| { id: 'AX', text: 'Aland Islands'}, | |
| { id: 'AL', text: 'Albania'}, | |
| { id: 'DZ', text: 'Algeria'}, | |
| { id: 'AS', text: 'American Samoa'}, | |
| { id: 'AD', text: 'Andorra'}, | |
| { id: 'AO', text: 'Angola'}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @version 1.0.2 | |
| // @name Removes the autoplay up next feature | |
| // @match *://www.youtube.com/* | |
| // @run-at document-start | |
| // @grant none | |
| // @noframes | |
| // ==/UserScript== | |
| (function () { | |
| 'use strict'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # postfix-wrapper.sh, version 0.1.0 | |
| # | |
| # You cannot start postfix in some foreground mode and | |
| # it's more or less important that docker doesn't kill | |
| # postfix and its chilren if you stop the container. | |
| # | |
| # Use this script with supervisord and it will take | |
| # care about starting and stopping postfix correctly. | |
| # |