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
#!/bin/bash | |
# pre-commit script to prevent merge markers from being committed. | |
# Adapted from here: | |
# https://jondowdle.com/2015/02/block-merge-conflicts-in-commits/ | |
# | |
# This simply searches the files that you are about to commit for seven <, >, or | |
# = at the beginning of a line, followed by a space or the end of the line. | |
changed=$(git diff --cached --name-only --diff-filter=ACM) |
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
# A shell function you can use to: | |
# - ls a dir | |
# - tail a file | |
# - edit a file | |
# - remove a file or directoty | |
lp () { | |
if [[ -z $1 ]]; then | |
path=.; | |
else | |
path=$1; |
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
''' | |
Here's a suggested revision with following changes: | |
1) Renamed field "message" as that is a reserved keyword in some dbs (must remember to change form.vars.message to form.vars.form_message in the call to send or it will be null and you get a nasty error, in 2.14.6 at least) | |
2) Checks if email actually sent, as otherwise the notification is erroneous. | |
3) Added reply_to, which helps. | |
3) Changed to use modern string formatting, just because. | |
4) Changed to not use flash message unless there's an error, because I think its nicer, but you may disagree :-) | |
''' | |
# append to scaffoling models/db.py |
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
''' | |
Place this in a controller and call it, either by url or directly from code. | |
An email(or multiple) with the correct settings will be sent to the | |
test address. | |
''' | |
def test_mail(): | |
bases = ['yourdomain.com', 'yourhosting.company.net'] | |
prefixes = ['smtp.', 'mail.', ''] | |
ports = [':25' ':465', ':993', ':587', ''] | |
sender = '[email protected]' |
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
""" | |
Script for creating past dated git commits. For the github green dots. | |
Usage: | |
>>> cheat 27/2 "my commit message" | |
will trigger: | |
>>>git commit -m "my commit message" |
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
/* | |
Wraps a db object such as PouchDB instance (currently just: post put get remove) | |
And ensures those actions, which are promises, resolve in the order they were called. | |
Essentially creates a synchronous interface to a db. | |
*/ | |
app.factory('QueuedResponseDb', function($q, ValueRegister) { | |
var QueuedResponseDb = function(db) { | |
var self = this; |
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
c = console; | |
angular.module('Test', []); | |
angular.module('Test').factory('Collection', function($q) { | |
var Collection = function() {var self = this; | |
self.__items = {}; | |
self.__relationships = []; | |
}; | |
var def = Collection.prototype; |
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
angular.module('turboshell').factory('MyWebSocket', function() { | |
/* | |
This only exists so I can mock it. You can mock it too. Haha, look at it! It's so tiny! Hahahahhha! | |
*/ | |
return WebSocket; | |
}); |
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
namespace DataTransferScript # ThirtyLineTestFramework | |
import System | |
import System.Reflection | |
import System.Runtime.Serialization | |
def RunTests(): | |
passCount = 0 | |
failCount = 0 | |
previousConsoleColour = Console.ForegroundColor |