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
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
type Person struct { | |
FirstName string | |
LastName string |
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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqr2() float64 { | |
return 2.0*2.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
// Paste in console | |
var getThings = function(){ | |
var divs = [...document.querySelectorAll("#manufacture__container > div")] | |
var things = divs.map(function(e){ | |
var result = {e}; | |
var spans = [...e.getElementsByTagName("span")] | |
spans.map(function(s){ | |
var str = s.innerText.replace(/[^/.0-9]/g, ''); | |
var a = str.split("/"); | |
var num = +a[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
from chaco.api import ArrayPlotData, GridContainer, Plot | |
from chaco.example_support import COLOR_PALETTE | |
from chaco.tools.api import PanTool, ZoomTool | |
from enable.api import ComponentEditor | |
from numpy import linspace | |
from scipy.special import jn | |
from traits.api import HasTraits, Int, Property | |
from traitsui.api import Group, Item, View | |
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
from traits.api import (HasTraits, Instance, Int, List, Property, Unicode, | |
on_trait_change) | |
from traitsui.api import HGroup, ModelView, UItem, View | |
COLUMNS_WIDTH = 200 | |
class Case(HasTraits): | |
param1 = Unicode | |
param2 = Unicode |
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
from traits.api import HTML, HasStrictTraits | |
from traitsui.api import UItem, View | |
class Test(HasStrictTraits): | |
html = HTML | |
traits_view = View(UItem('html')) | |
def _html_default(self): | |
return """ |
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
from numpy import array, inf, linspace | |
from scipy.special import jn | |
from chaco.api import ArrayDataSource, ArrayPlotData, DataLabel, Plot | |
from chaco.tools.api import SimpleInspectorTool | |
from enable.api import BaseTool, ComponentEditor | |
from traits.api import HasTraits, Instance, on_trait_change | |
from traitsui.api import Item, View | |
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
# 24 bytes (192 bits) is more than sufficient to make any ID unguessable. | |
# If you're insanely paranoid, you can bump this to 48 bytes (384 bits). | |
# | |
# If you want to use a number of bytes that is not a multiple of 24, | |
# then you will need to strip the '=' characters from the end of the | |
# byte string generated by urlsafe_b64encode. | |
# See https://neilmadden.blog/2018/08/30/moving-away-from-uuids/ for how to | |
# estimate the amount of time it would require to guess an ID. |