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
require "formula" | |
require_relative "lib/private_strategy" | |
class Hoge < Formula | |
homepage "https://github.com/yourcompany/hoge" | |
url "https://github.com/yourcompany/hoge/releases/download/v0.1.0/hoge_v0.1.0_darwin_amd64.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy | |
sha256 "6de411ff3e4b1658a413dd6181fcXXXXXXXXXXXXXXXXXXXX" | |
head "https://github.com/yourcompany/hoge.git" | |
version "0.1.0" |
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
go func() { | |
for { | |
err = rmq.Stream(cancelCtx) | |
if errors.Is(err, rabbitmq.ErrDisconnected) { | |
continue | |
} | |
break | |
} | |
}() |
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
# (c) 2020 Humu | |
# MIT License | |
from typing import Any | |
import github | |
AUTOMERGE_LABEL_NAME = 'automerge' | |
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
"""Middleware that removes additional meaningless backslashes. | |
This transforms URLs as follows: | |
- yourwebsite.com// to yourwebsite.com | |
- yourwebsite.com/section/// to yourwebsite.com/section | |
Ideally, this middleware should be placed before Commonmiddleware to avoid | |
conflicts with APPEND_SLASH. However, this code already appends final slash | |
if APPEND_SLASH is set to TRUE trying to reduce one additional redirect. |
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
function dots(width, height, density) { | |
for (let i = 0; i < density; i += 1) { | |
createDot( | |
Math.floor(Math.random() * width), | |
Math.floor(Math.random() * height), | |
); | |
} | |
} | |
function createDot(x, y) { |
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
io.on('connection', function(socket){ | |
/* 'connection' is a special event fired on the server when any new connection is made */ | |
}) | |
socket.on('disconnect', function(){ | |
/* When this individual socket has disconnected, this special event fires */ | |
}) | |
/* This will send the event 'foobar' with the data to | |
every connected to socket */ |
#Webpack + ES6 + Sass + Live reload
Basic example of webpack config to work with sass, es6 and live reload.
To get live reload working you need:
- get package.json and webpack.config.js to your project foldee
- run in terminal npm install
- add this script <script src="http://localhost:35729/livereload.js"></script> to your index.html
- create src folder and src files
- run in terminal webpack
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
<cfcontent type="text/html; charset=UTF-8"> | |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>Sanitize target="_blank"</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.slim.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
/* 3/24/2017 Sanitize_Target_Blank.htm https://gist.github.com/JamoCA/80f65eb07f054b1326221bd4f15868d6 */ | |
function sanitizeTargetBlank(){ | |
$('#linkDiv a[rel~=external]').prop('target', '_blank'); |
- View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
- View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
- HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
- String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
NewerOlder