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
| /* | |
| source: https://openuserjs.org/libs/soufianesakhi/node-creation-observer | |
| Use cases | |
| 1: Apply a callback each time a type of node is created | |
| Fire a callback each time an element that matches the selector is created. | |
| Don't apply the callback for the same element multiple times. | |
| In this case, the removeOnFirstMatch property should be set to false. | |
| 2: Wait for the creation of one node and apply a callback |
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
| // ---------------------------------------------------------------------------------------------------- | |
| // - Display Errors | |
| // ---------------------------------------------------------------------------------------------------- | |
| ini_set('display_errors', 'On'); | |
| ini_set('html_errors', 0); | |
| // ---------------------------------------------------------------------------------------------------- | |
| // - Error Reporting | |
| // ---------------------------------------------------------------------------------------------------- | |
| error_reporting(-1); |
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/sh | |
| # sshput <remotehost> | |
| # | |
| # Puts your local DSA public key into the .ssh/authorized_keys | |
| # on a remote machine. This should allow you to login without | |
| # needing a password. | |
| # | |
| # This software comes with no guarantees whatsoever, and is yours to | |
| # do with as you will. I'd be grateful if you feed any generally-useful | |
| # improvements back to me, for the benefit of others. |
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 python | |
| # | |
| # fakemail (Python version) | |
| # | |
| # $Id: fakemail.py,v 1.1 2005/08/29 22:04:55 lastcraft Exp $ | |
| import asyncore | |
| import getopt | |
| import os |
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 | |
| #TODO option to set --include patterns | |
| ### ABOUT | |
| ### Runs rsync, retrying on errors up to a maximum number of tries. | |
| ### Simply edit the rsync line in the script to whatever parameters you need. | |
| # Trap interrupts and exit instead of continuing the loop | |
| trap "echo Exited!; exit;" SIGINT SIGTERM |
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
| <?php | |
| //Useful code snippets | |
| //Here are some code snippets which show you the basics of Auth: | |
| //Create a new user (e.g. if you have not set up any users yet and want to do that programmatically) | |
| $model = ORM::factory('user'); | |
| $model->values(array( | |
| 'username' => 'admin', | |
| 'email' => 'admin@example.com', | |
| 'password' => 'admin', |