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
using System; | |
using System.Web; | |
using System.Web.Optimization; | |
using System.Collections; | |
using Microsoft.Ajax.Utilities; | |
using System.Collections.Generic; | |
using System.Text; | |
//example bundle configuration | |
public class BundleConfig |
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
class HealthCheckResponder | |
def initialize(app, options = {}) | |
@app = app | |
end | |
def call(env) | |
if env["REQUEST_PATH"] == "/health_check" | |
return [200, {}, [""]] | |
else |
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
http { | |
# Default virtual host for www.example.com. This will pick up all HTTP | |
# requests to port 80 that are not for one of the other virtual hosts. | |
server { | |
listen 80; | |
server_name www.example.com; | |
# ...your server config here... |
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
using System.Collections.Specialized; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
namespace My.App | |
{ | |
public static class Extensions | |
{ | |
/// <summary> |
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
buttonHTML = """<button type="button" class="attach" data-action="x-attach">Attach Files</button>""" | |
fileInputHTML = """<input type="file" multiple>""" | |
$(Trix.config.toolbar.content).find(".button_group.block_tools").append(buttonHTML) | |
$(document).on "trix-action-invoke", ($event) -> | |
if $event.originalEvent.actionName is "x-attach" | |
editorElement = $event.target | |
editorElement.focus() |
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
# Natively, Enumerators get JSONized like "#<Enumerator::Lazy:0x007f8714807080>", or they explode, either of which is a problem. | |
# We want them to make an array, and do it lazily so we don't have to keep the items in memory! | |
class Enumerator | |
def to_json(state) | |
state.depth += 1 | |
string = "[\n" | |
first_item = true | |
self.each do |item| |
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
<?php | |
namespace NoxLogic\DemoBundle\Form\Type; | |
use Doctrine\ORM\EntityManager; | |
use NoxLogic\DemoBundle\Entity\Province; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\Form\FormEvent; | |
use Symfony\Component\Form\FormEvents; |
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
use Zend\Mail\Message; | |
use Zend\Mail\Transport\Smtp as SmtpTransport; | |
use Zend\Mime\Message as MimeMessage; | |
use Zend\Mime\Part as MimePart; | |
use Zend\Mail\Transport\SmtpOptions; | |
////////// | |
$message = new 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
# | |
# See also: http://almosteffortless.com/2008/12/11/easy-upload-via-url-with-paperclip/ | |
# | |
# Allow "uploads via url" with Rails and Paperclip | |
# | |
# http://www.thoughtbot.com/projects/paperclip | |
# http://github.com/thoughtbot/paperclip/tree/master | |
# http://groups.google.com/group/paperclip-plugin/browse_thread/thread/456401eb93135095 | |
# | |
# This example is designed to work with a "Photo" model that has an "Image" attachment |
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
<?php | |
/* * | |
* @filename downloader.class.php | |
* @author PsyKzz | |
* @version 1.0.0 | |
* @description Simple class to rate limit your downloads, while also providing a custom tickrate to combat timeout issues. | |
* @url http://www.psykzz.co.uk | |
* | |
* @license 'WTFPL ' - "Do What The Fuck You Want To Public License". | |
* This program is free software. It comes without any warranty, to |
OlderNewer