View scroll.scss
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
.scrollable-y-with-hide { | |
overflow-y: hidden; | |
&:hover { | |
overflow-y: auto; | |
// https://stackoverflow.com/a/54979559/375050 | |
// only for WebKit so that scrollbars do not take space and cause content to overflow | |
overflow-y: overlay; | |
} | |
&::-webkit-scrollbar-thumb { | |
background: hsla(0%, 0%, 0%, 0.4); |
View application_helper.rb
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
def ellipsis_text(s, limit=90) | |
if s&.length>limit | |
(s.slice(0..limit) + | |
'... ' + | |
content_tag(:a, 'More', | |
class: 'more semibold small', | |
href: '#', | |
onClick: "$(this.nextElementSibling).removeClass('hide'); $(this).addClass('hide'); return false;") + | |
content_tag(:span, s.slice(90..-1), class: 'hide')).html_safe | |
else |
View iodide-toolbox.py
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
print('hello from iodide-toolbox'); |
View train.py
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
import argparse | |
import os | |
import torch | |
import torch.backends.cudnn as cudnn | |
import torch.nn as nn | |
import torch.nn.parallel | |
import torch.optim | |
import torch.utils.data | |
import torchvision.transforms as transforms |
View bbox_utils.py
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
def transform_predicitions(window_prediction_bbox, xs, ys): | |
''' | |
Transform SSD bounding boxes in a sliding window, to absolute coordinates in the original image | |
''' | |
r= [] | |
for label, score, xmin, ymin, xmax, ymax in window_prediction_bbox: | |
label = int(label) | |
xmin = math.ceil(xmin*box_width)+xs | |
xmax = math.ceil(xmax*box_width)+xs | |
ymin = math.floor(ymin*box_height)+ys |
View App.js
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
export default class App extends React.Component { | |
render() { | |
return <Router> | |
<Scene key="root" navBar={Platform.OS=='ios' ? NavBar : NavBarAndroid}> | |
<Scene key="home" component={HomeScreen} ... /> | |
</Scene> | |
</Router> | |
} | |
} |
View DraggableModal.js
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
import { Modal } from 'react-bootstrap' | |
import ModalDialog from 'react-bootstrap/lib/ModalDialog' | |
class DraggableModalDialog extends React.Component { | |
render() { | |
return <Draggable handle=".modal-title"><ModalDialog {...this.props} /></Draggable> | |
} | |
} | |
// enforceForce=false causes recursion exception otherwise.... |
View _MultiSelect.scss
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
// https://github.com/furqanZafar/react-selectize/blob/develop/src/MultiSelect.styl | |
.react-selectize.multi-select .simple-value { | |
background: #f2f9fc; | |
border: 1px solid #c9e6f2; | |
border-radius: 2px; | |
color: #0088cc; | |
display: inline-block; | |
margin: 2px; | |
vertical-align: middle; |
View sinatra_proxy
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
Testing client side app (like BackboneJS) with Capybara, VCR, webmock, factory girl |
View AccountAuthenticator.java
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
public class AccountAuthenticator extends AbstractAccountAuthenticator { | |
private final Context context; | |
@Inject @ClientId String clientId; | |
@Inject @ClientSecret String clientSecret; | |
@Inject ApiService apiService; | |
public AccountAuthenticator(Context context) { | |
super(context); |
NewerOlder