This file contains hidden or 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
| // Cloudflare Worker: firmware proxy | |
| // Endpoint: https://example.com/download?firmware=[safe-encoded-url] | |
| // Accepts either URL-encoded URL or base64url in the "firmware" param. | |
| // Only proxies from https://files.nervescloud.com/firmware/... | |
| const ALLOWED_HOST = "files.nervescloud.com"; | |
| const REQUIRED_PREFIX = "/firmware/"; | |
| export default { | |
| async fetch(request, env, ctx) { |
This file contains hidden or 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
| defmodule Board do | |
| alias IslandsEngine.{Coordinate, Island} | |
| def position_island(board, key, %Island{} = island) do | |
| case overlaps_existing_island?(board, key, island) do | |
| true -> {:error, :overlapping_island} | |
| false -> Map.put(board, key, island) | |
| end | |
| end |
This file contains hidden or 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
| gulp.task('server', function() { | |
| browserSync.init({ | |
| proxy: { | |
| target: 'localhost:3000', | |
| reqHeaders: function () { | |
| return { host: 'localhost:8000' }; | |
| } | |
| }, | |
| port: 8000, | |
| open: true, |
This file contains hidden or 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
| Well i didn't see any thread about this so let's start one :DRINK: | |
| Specify the Directory Index: | |
| DirectoryIndex newindex.html | |
| Specify 404 error: | |
| ErrorDocument 404 /404error.html | |
| Redirect 301 | |
| Redirect 301 /old.html /new.html |
This file contains hidden or 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
| d = new Date(); // => Thu Feb 26 2015 22:16:14 GMT-0600 (CST) | |
| d.toMySQLDateTime(); // => 2015-02-26 22:16:14 | |
| Date.prototype.toMySQLDateTime = function () { | |
| function addZ(n) { | |
| return (n<10? '0' : '') + n; | |
| } | |
| return this.getFullYear() + '-' + | |
| addZ(this.getMonth() + 1) + '-' + | |
| addZ(this.getDate()) + ' ' + |
This file contains hidden or 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
| <html> | |
| <head> | |
| <title>Timestamp</title> | |
| </head> | |
| <script> | |
| var myTimer; | |
| function getTime(){ | |
| var xmlhttp; | |
| var span; | |
| if (window.XMLHttpRequest) |
This file contains hidden or 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 ApplicationHelper | |
| DEFAULT_KEY_MATCHING = { | |
| alert: :alert, | |
| notice: :success, | |
| info: :standard, | |
| secondary: :secondary, | |
| success: :success, | |
| error: :alert, | |
| warning: :warning | |
| } |
This file contains hidden or 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 | |
| cd /home/user/pathto/weatherapi | |
| wget -O http://api.wunderground.com/api/heregoeskey/forecast/lang:SP/q/Mexico/Monterrey.json |
NewerOlder