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
..... | |
config.middleware.insert_after 'Rack::Cache', 'ReconnectMongo' | |
.... |
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
$.ajax = (options) -> | |
# console.log 'forge ajax', options | |
dfd = jQuery.Deferred() | |
options.success = (data) -> | |
# console.log "forge ajax resolve", data | |
$(document).trigger 'ajaxStop', [null, options] | |
dfd.resolve data | |
options.error = (error) -> | |
console.log "forge ajax reject", error |
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
^(?!.*(PullToRefresh|SherlockFragmentActivity|IInputConnectionWrapper|LightsService|CalendarSyncAdapter|Watson|ActionBarSherlock|alsa_ucm|mm-camera|qcom_sensors_hal|CellInfoLte|WirelessDisplayService|TELEPHONY_CALLBACK|StatusBar.*|memalloc|AlarmManager|SIGNAL_ICON|StateMachine|ThermalDaemon|overlay|AudioTrack|Trace|SyncManager|libEGL|GCMBaseIntentService|SubscribedFeeds|PackageManager|StorageNotification|libgps|DownloadManager|MountService|ActivityThread|SpannableStringBuilder|AlertService|Gmail|SurfaceFlinger|PhoneStatusBar|MtpService|PicasaUploader|chromium|BackupHelperDispatcher|BackupManagerService|PerformBackupTask|KeyInputQueue|LocationMasfClient|KeyguardViewMediator|WindowManager|InputDevice|jdwp|RecognizerEngine|VoiceDialerReceiver|PackageIntentReceiver|installd|UNA|VoldCmdListener|UnlockClock|sensor_stub|PowerManagerService|ExchangeService|EventLogService|Finsky|Zygote|BatteryService|SntpClient|ActivityManager|CalendarProvider2|SyncCampaign|AlarmScheduler|StatusBarPolicy|NetworkStatusReceiver|KeyChar |
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); |
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 |
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; |
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.... |
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> | |
} | |
} |
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 |
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 |
OlderNewer