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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
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
// Audio Buffer Source | |
var fileInput = $("#audio-file"); | |
bufferSource.gain.value = 1; | |
bufferSource.loop = true; | |
bufferSource.connect(oscillatorGain); | |
fileInput.addEventListener("change", function() { | |
var reader = new FileReader(); | |
reader.onload = function(ev) { | |
context.decodeAudioData(ev.target.result, function(buffer) { |
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 UIKit | |
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
override func didReceiveMemoryWarning() { |
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
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { | |
// Override point for customization after application launch. | |
self.window = UIWindow(frame: UIScreen.mainScreen().bounds) | |
var nav1 = UINavigationController() | |
var first = FirstViewController(nibName: nil, bundle: nil) | |
nav1.viewControllers = [first] | |
var second = SecondViewController(nibName: nil, bundle: nil) | |
var nav2 = UINavigationController() |
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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, routes = require('./routes') | |
, user = require('./routes/user') | |
, http = require('http') | |
, path = require('path'); |
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
# -*- coding: utf-8 -*- | |
from flask import Flask, jsonify, url_for, redirect, request | |
from flask_pymongo import PyMongo | |
from flask_restful import Api, Resource | |
app = Flask(__name__) | |
app.config["MONGO_DBNAME"] = "students_db" | |
mongo = PyMongo(app, config_prefix='MONGO') | |
APP_URL = "http://127.0.0.1:5000" |
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
// | |
// CoreDataStackInMemory.swift | |
// TripPlanner | |
// | |
// Created by Benjamin Encz on 7/20/15. | |
// Copyright © 2015 Make School. All rights reserved. | |
// | |
// Structure is inspired by: http://martiancraft.com/blog/2015/03/core-data-stack/, Thanks! |
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 unittest | |
def factorial(n): | |
"""factorial(n) returns the product of the integers 1 through n for n >= 0, | |
otherwise raises ValueError for n < 0 or non-integer n""" | |
# implement factorial_iterative and factorial_recursive below, then | |
# change this to call your implementation to verify it passes all tests | |
# return factorial_iterative(n) | |
return factorial_recursive(n) |