- GitHub Staff
- https://www.smockle.com/
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 trash = []; | |
function computationallyIntensiveStuff() { | |
trash.push(Math.pow(Math.pow(Math.cos(Math.sin(Math.random())), Math.random()), Math.random() * 100000)); | |
trash.filter(function (a) { return a > Math.random(); }); | |
} | |
new Promise(function (resolve, reject) { | |
for (var i = 0; i < 1000; i++) { |
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 getTestPeople() { | |
return [{ | |
name: "Kylie", | |
age: 18 | |
}, { | |
name: "Andrew", | |
age: 23 | |
}, { | |
name: "Andrew", | |
age: 18 |
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
NameVirtualHost 127.0.0.1:80 | |
<VirtualHost 127.0.0.1:80> | |
ServerName pow | |
ServerAlias *.dev | |
ServerAlias *.xip.io | |
ProxyPass / http://localhost:20559/ | |
ProxyPassReverse / http://localhost:20559/ | |
ProxyPreserveHost On |
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
HttpContext.Current.Response.BufferOutput = true; | |
HttpContext.Current.Response.ClearContent(); | |
HttpContext.Current.Response.ClearHeaders(); | |
HttpContext.Current.Response.AddHeader("Cache-control", "no-store"); | |
HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=\"" + fileName + "\""); | |
HttpContext.Current.Response.ContentType = dr["MimeType"].ToString(); | |
HttpContext.Current.Response.AddHeader("Content-Length", fileblob.Length.ToString()); | |
HttpContext.Current.Response.BinaryWrite(fileblob); | |
HttpContext.Current.Response.Flush(); | |
HttpContext.Current.ApplicationInstance.CompleteRequest(); |
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
# DATABASE TYPES | |
# eg. field_name:field_type | |
:string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean, :references |
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
// jonathantneal's polyfill for matchesSelector | |
if (this.Element) function(ElementPrototype) { | |
ElementPrototype.matches = ElementPrototype.matchesSelector = | |
ElementPrototype.matchesSelector || | |
ElementPrototype.webkitMatchesSelector || | |
ElementPrototype.mozMatchesSelector || | |
ElementPrototype.msMatchesSelector || | |
ElementPrototype.oMatchesSelector || | |
function (selector) { | |
var nodes = (this.parentNode || this.document).querySelectorAll(selector), i = -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
var auburnBuildingNames; | |
window.getAuburnBuildingNames = function(callback) { | |
if (auburnBuildingNames) { | |
callback(auburnBuildingNames); | |
} else { | |
var buildings; | |
$.getJSON("https://cws.auburn.edu/map/api/3.0/building", function(data) { | |
buildings = $.map(data, function(building, i) { | |
return building.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
using System.Web; | |
using System.Web.Optimization; | |
using BundleTransformer.Core.Transformers; | |
namespace Project { | |
public class BundleConfig { | |
public static void RegisterBundles(BundleCollection bundles) { |
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
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> | |
<%= Html.WriteToJavaScript(Model, "window.model") %> | |
</asp:Content> |
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
# Include this in your .irbrc | |
def unbundled_require(gem, options = {}) | |
if defined?(::Bundler) | |
spec_path = Dir.glob("#{Gem.dir}/specifications/#{gem}-*.gemspec").last | |
if spec_path.nil? | |
warn "Couldn't find #{gem}" | |
return | |
end | |
spec = Gem::Specification.load spec_path |
OlderNewer