Skip to content

Instantly share code, notes, and snippets.

Alon Burg burgalon

Block or report user

Report or block burgalon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@burgalon
burgalon / train.py
Created Nov 29, 2017
finetune imagenet
View train.py
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
@burgalon
burgalon / bbox_utils.py
Created May 16, 2017
Utilities for bounding box
View bbox_utils.py
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
@burgalon
burgalon / App.js
Created Apr 28, 2016
use ToolbarAndroid with react-native-router-flux
View App.js
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>
}
}
@burgalon
burgalon / DraggableModal.js
Created Mar 31, 2016
Draggable React Bootstrap modal
View DraggableModal.js
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....
@burgalon
burgalon / _MultiSelect.scss
Created Jan 5, 2016
react-selectize styles in SCSS
View _MultiSelect.scss
// 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;
@burgalon
burgalon / sinatra_proxy
Last active Sep 6, 2017
Testing client side app (like BackboneJS) with Capybara, VCR, webmock, factory girl
View sinatra_proxy
Testing client side app (like BackboneJS) with Capybara, VCR, webmock, factory girl
@burgalon
burgalon / AccountAuthenticator.java
Last active Nov 12, 2019
Implementing OAuth2 with AccountManager, Retrofit and Dagger
View AccountAuthenticator.java
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);
@burgalon
burgalon / gist:5579233
Last active Mar 9, 2017
Filter all extra logs "by Log Tax (regex)" in IntelliJ for Android adb logcat that are not relevant to debugging an app
View gist:5579233
^(?!.*(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
@burgalon
burgalon / ajax.coffee
Created Oct 7, 2012
Trigger.io jQuery adapter to use forge.ajax
View ajax.coffee
$.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
You can’t perform that action at this time.