TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
defmacro defbang({ name, _, args }) do | |
unless args |> is_list do | |
args = [] | |
end | |
quote bind_quoted: [name: Macro.escape(name), args: Macro.escape(args)] do | |
def unquote(to_string(name) <> "!" |> String.to_atom)(unquote_splicing(args)) do | |
case unquote(name)(unquote_splicing(args)) do | |
:ok -> | |
:ok |
#ifndef __LAB_COLORSPACE__ | |
#define __LAB_COLORSPACE__ | |
/* | |
* Conversion between RGB and LAB colorspace. | |
* Import from flowabs glsl program : https://code.google.com/p/flowabs/source/browse/glsl/?r=f36cbdcf7790a28d90f09e2cf89ec9a64911f138 | |
*/ | |
float3 rgb2xyz( float3 c ) { | |
float3 tmp; |
from keras.models import Sequential | |
from keras.layers import Dense | |
x, y = ... | |
x_val, y_val = ... | |
# 1-dimensional MSE linear regression in Keras | |
model = Sequential() | |
model.add(Dense(1, input_dim=x.shape[1])) | |
model.compile(optimizer='rmsprop', loss='mse') |
module.exports = (file, api, options) => { | |
const j = api.jscodeshift; | |
const printOptions = options.printOptions || {quote: 'single'}; | |
const root = j(file.source); | |
const requires = {}; | |
const filterAndTransformRequires = path => { | |
const varName = path.value.local.name; | |
const scopeNode = path.parentPath.scope.node; |
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that | |
// does not support `nomodule` is probably not being used anywhere. The code below is left | |
// for posterity. | |
/** | |
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will | |
* load <script nomodule> anyway. This snippet solve this problem, but only for script | |
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script> | |
* | |
* Again: this will **not** prevent inline script, e.g.: |
from enum import Enum, EnumMeta | |
class ChoiceEnumMeta(EnumMeta): | |
def __iter__(self): | |
return ((tag, tag.value) for tag in super().__iter__()) | |
class ChoiceEnum(Enum, metaclass=ChoiceEnumMeta): | |
""" |
import React from 'react'; | |
import { DetectExternalEvents } from './detectexternalevents'; | |
const EXTERNAL_REACT_EVENTS = ['onMouseDown', 'onTouchStart']; | |
const EXTERNAL_DOM_EVENTS = ['mousedown', 'touchstart']; | |
export interface IDetectExternalClickProps { | |
component?: string; | |
onExternalClick: (event: Event) => void; |