This Gist wa
This file contains 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
/* Need to add www-data to group shadow (and restart apache) | |
$ sudo adduser www-data shadow | |
$ sudo /etc/init.d/apache2 restart | |
Needs whois to be installed to run mkpasswd | |
$ sudo apt-get install whois | |
Assumes that sha-512 is used in shadow file | |
*/ | |
function authenticate($user, $pass){ | |
// run shell command to output shadow file, and extract line for $user |
This file contains 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
import faker from "https://cdn.jsdelivr.net/npm/@faker-js/faker@6.0.0-alpha.3/dist/faker.min.js"; ///**import and configure faker** | |
faker.locales[faker.locale].name.male_prefix = ["Mr.", "Dr."]; | |
faker.locales[faker.locale].name.female_prefix = ["Mrs.", "Miss.", "Dr."]; | |
window.faker = faker; |
This file contains 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
import sublime | |
import sublime_plugin | |
STANDARD_SETTINGS_FILE = "StandardFormat.sublime-settings" | |
SEMI_STANDARD_SETTINGS_FILE = "SemiStandardFormat.sublime-settings" | |
def plugin_loaded(): | |
global standardSettings | |
global semiStandardSettings | |
standardSettings = sublime.load_settings(STANDARD_SETTINGS_FILE) |
This file contains 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
import fiona from 'fiona' | |
import './lorem' | |
import './nino' | |
const seeded = fiona() | |
seeded.lorem() | |
seeded.sentence() |
This Gist was automatically created by Carbide, a free online programming environment.
This file contains 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
$.hook = function (fns){ | |
fns = typeof fns === 'string' ? fns.split(' ') : $.makeArray(fns); | |
jQuery.each( fns, function (i, method) { | |
var old = $.fn[ method ]; | |
if( old && !old.__hookold ){ | |
$.fn[ method ] = function(){ | |
this.triggerHandler('onbefore'+method); | |
this.triggerHandler('on'+method); | |
var ret = old.apply(this, arguments); | |
this.triggerHandler('onafter'+method); |
NewerOlder