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
package com.example.controllers; | |
import com.example.models.Resource; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.bind.annotation.PathVariable; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RequestMethod; | |
import org.springframework.web.bind.annotation.RequestParam; | |
import org.springframework.web.bind.annotation.RestController; |
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 servephp() { | |
local port="${1:-8080}" | |
open "http://localhost:${port}" | |
php -S localhost:$port | |
} | |
function serve() { | |
local port="${1:-8000}" | |
open "http://localhost:${port}" | |
python -m SimpleHTTPServer "$port" |
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 com.google.common.base.Defaults; | |
import com.google.common.collect.Sets; | |
import javax.annotation.Nonnull; | |
import java.beans.BeanInfo; | |
import java.beans.Introspector; | |
import java.beans.PropertyDescriptor; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import java.util.Set; |
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 | |
############################################################ | |
# First, you must build the library files for the protobuf | |
# tool. In order to do this, follow the steps below in the | |
# source directory for protobuf. | |
# | |
# 1. ./autogen.sh | |
# 2. ./configure | |
# 3. make | |
# |
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($, undefined) { | |
var dependencies = {}, | |
instances = {}; | |
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; | |
function stripComments(functionString) { | |
return functionString.replace(STRIP_COMMENTS, ''); | |
} | |
var FN_NEW_LINE_REPLACE = /[\s\r\n]+/; |
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
/** | |
* @fileoverview Useful data operations for manipulating large sets of data. | |
* | |
* I initially wrote this utility for handling the idea-frameworks | |
* documentation generator where I would group and regroup data into more | |
* manageable chunks. | |
*/ | |
var util = require('util'); | |
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() { | |
var $ = function(str) { | |
return document.querySelector(str); | |
}; | |
var win = window; | |
var doc = document.documentElement; | |
var mast = $('#js-repo-pjax-container .pagehead'); | |
var mastTop = mast.offsetTop; | |
var adjustedMargin = mast.offsetHeight; |
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
javascript:(function() {var $ = function(str) {return document.querySelector(str);};var win = window;var doc = document.documentElement;var mast = $('#js-repo-pjax-container .pagehead');var mastTop = mast.offsetTop;var adjustedMargin = mast.offsetHeight;var currentMastAttributes = mast.getAttribute('style');var newMastAttributes = [currentMastAttributes,'position: fixed;','z-index: 10;','top: 0;','left: 0;','right: 0;'].join('');var content = $('#js-repo-pjax-container .repo-container');var currentContentAttributes = content.getAttribute('style');var newContentAttributes = [currentContentAttributes,'margin-top: ' + adjustedMargin + 'px;'].join('');var toggle = false;document.addEventListener('scroll', function() {var scrollTop = (win.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);if (scrollTop > mastTop) {content.setAttribute('style', newContentAttributes);mast.setAttribute('style', newMastAttributes);toggle = true;setTimeout(function() {toggle = false}, 100);} else if (!toggle) {content.setAttribute(' |
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
// provide our own undefined | |
const undefined = void(0); | |
// provide an extend method | |
Object.extend = function(protoTo, ...protoFroms) { | |
protoFroms.forEach(function(protoFrom) { | |
Object.keys(protoFrom).forEach(function(key) { | |
if (protoTo[key] === undefined) | |
protoTo[key] = protoFrom[key]; | |
}); |
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
declare module "gremlin" { | |
export namespace driver { | |
import TraversalStrategy = process.TraversalStrategy; | |
import Traversal = process.Traversal; | |
import Bytecode = process.Bytecode; | |
import GraphSONReader = structure.io.GraphSONReader; | |
import GraphSONWriter = structure.io.GraphSONWriter; | |
export class RemoteConnection { | |
constructor(url: string); |
OlderNewer