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
var app = angular.module("mymapingapp", [ | |
"leaflet-directive" | |
]); | |
app.controller('MainCtrl', ['$scope', function($scope) { | |
// make map | |
angular.extend($scope, { | |
san_fran: { | |
lat: 37.78, | |
lng: -122.42, |
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
var Node = function(value){ | |
var node = {}; | |
node.value = value; | |
node.next = null; | |
return node; | |
}; | |
var LinkedList = function(){ |
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
// Bandpage API | |
var BANDPAGE_APP_ID = '4945-------953728'; | |
var BANDPAGE_API_KEY = '5ae045d8e3-------92177c69'; | |
var BANDPAGE_API_SECRET = '055837ad8400---------058e7d1e3'; | |
var BANDPAGE_BASE = 'https://api-read.bandpage.com/'; | |
var request = require('request'); | |
var kelly_clarkson_bid = '12334995322703872'; |
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 to get "Popular tickets in SF Bay Area" from songkick | |
//====== | |
var fs = require('fs'); | |
var cheerio = require('cheerio'); | |
var webdriverio = require('webdriverio'); | |
var options = { desiredCapabilities: { browserName: 'chrome' } }; | |
var client = webdriverio.remote(options); | |
var outputPath = './results.json'; |
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
var got = require('got'); | |
var cheerio = require('cheerio'); | |
var redditUrl = 'http://web.archive.org/web/20120216223019/http://www.reddit.com/r/science/'; | |
var nextUrl = 'https://web.archive.org/web/20030910064848/http://www.ed.gov/index.jhtml'; | |
got(redditUrl, function(err, html){ | |
var $ = cheerio.load(html); |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*" | |
} | |
] |
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> | |
var host = "YOURDOMAIN.github.io"; | |
if ((host == window.location.host) && (window.location.protocol != "https:")) | |
window.location.protocol = "https"; | |
</script> |
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 App\Http\Controllers; | |
use Illuminate\Http\Request; | |
class AdminController extends Controller | |
{ | |
public function __construct() | |
{ | |
$this->middleware('auth'); |
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
function linearSearch(array, toFind){ | |
for(let i = 0; i < array.length; i++){ | |
if(array[i] === toFind) return i; | |
} | |
return -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
function binarySearch(arr, target) { | |
let left = 0; | |
let right = arr.length - 1; | |
while (left <= right) { | |
const mid = left + Math.floor((right - left) / 2); | |
if (arr[mid] === target) { | |
return mid; | |
} | |
if (arr[mid] < target) { | |
left = mid + 1; |
OlderNewer