Skip to content

Instantly share code, notes, and snippets.

View mstepanov's full-sized avatar

Max Stepanov mstepanov

  • Palo Alto, CA
  • 00:17 (UTC -07:00)
View GitHub Profile
@panovr
panovr / finetune.py
Created March 2, 2017 23:04
Fine-tuning pre-trained models with PyTorch
import argparse
import os
import shutil
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
@kukuruza
kukuruza / cifar10_vis_excitations.py
Last active January 30, 2023 12:56
Visualize deeper layers in Tensorflow by displaying images which gain the highest response from neurons. Written for cifar10 model.
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@stenstorp
stenstorp / maya2016.sh
Last active December 8, 2022 06:37 — forked from MichaelLawton/gist:ee27bf4a0f591bed19ac
Installing Maya 2016 SP6 on Ubuntu 16.04 with Student License
#!/bin/bash
#Download Maya from here: http://download.autodesk.com/us/support/files/maya_2016_service_pack_6/Autodesk_Maya_2016_SP6_EN_Linux_64bit.tgz
#Get a student License from: http://www.autodesk.com/education/free-software/maya
#Log in and select maya 2016, your language and an OS. Either should work.
# !!!!!! IMPORTANT !!!!!!
# BEFORE RUNNING, REPLACE "USER" AND "HOME" AT THE BOTTOM OF THIS SCRIPT WITH YOUR USERNAME AND HOME FOLDER
# !!!!!! IMPORTANT !!!!!!
@AliSoftware
AliSoftware / struct_vs_inheritance.swift
Last active March 27, 2024 11:57
Swift, Struct & Inheritance: How to balance the will of using Struct & Value Types and the need for Inheritance?
// #!Swift-1.1
import Foundation
// MARK: - (1) classes
// Solution 1:
// - Use classes instead of struct
// Issue: Violate the concept of moving model to the value layer
// http://realm.io/news/andy-matuschak-controlling-complexity/
@MarkVillacampa
MarkVillacampa / JavaScriptCore.m
Last active December 27, 2015 19:49
Trying to add methods at runtime for the JSExport protocol in JavaScriptCore. As-is, the method is not called from Javascript. Uncomment lines 7-8 and the end of 11, comment line 65, and run. The method is now called from JavaSript. Any idea why?
#import <Foundation/Foundation.h>
#import <JavaScriptCore/JavaScriptCore.h>
#import <objc/runtime.h>
const char *_protocol_getMethodTypeEncoding(Protocol *, SEL, BOOL isRequiredMethod, BOOL isInstanceMethod);
//@protocol MyProtocol <JSExport>
// -(void)one:(id)one;
//@end
@jlongster
jlongster / cloth-lljs.js
Last active December 16, 2015 03:29
large LLJS example
extern clear, fillRect, renderLine, print;
struct Vec2d {
function void Vec2d(float x, float y) {
this->x = x;
this->y = y;
}
float x;
---
name: Titanium.UI
extends: Titanium.Module
methods:
- name: createListView
summary: creates a new instance of [View](Titanium.UI.ListView)
parameters:
- name: parameters
type: Dictionary<Titanium.UI.ListView>
@krzysztofzablocki
krzysztofzablocki / gist:4396302
Last active November 24, 2021 19:17
Set symbol breakpoint on objc_msgSend then setup this debug command to log all methods called in iOS Simulator. If you want to do device debugging change esp+4 register to r0, esp+8 to r1 Found long ago somewhere on stackoverflow.
expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) )
@rodw
rodw / backup-github.sh
Last active March 30, 2024 15:04
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
#-------------------------------------------------------------------------------
# NOTES:
#-------------------------------------------------------------------------------
# * Under the heading "CONFIG" below you'll find a number of configuration
# parameters that must be personalized for your GitHub account and org.
# Replace the `<CHANGE-ME>` strings with the value described in the comments
# (or overwrite those values at run-time by providing environment variables).
@n8gray
n8gray / configure-ios
Created January 19, 2012 18:51
A script to configure autotools software for iOS
#!/bin/bash
################################################################################
#
# Copyright (c) 2008-2009 Christopher J. Stawarz
#
# Modified by Nathaniel Gray in 2012 to support Clang, custom dev tool locations,
# and armv7. Also removed "make install" phase, since that can easily be done by
# hand.
#