Skip to content

Instantly share code, notes, and snippets.

@thomwolf
thomwolf / parallel.py
Last active August 8, 2023 15:50
Data Parallelism in PyTorch for modules and losses
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Hang Zhang, Rutgers University, Email: zhang.hang@rutgers.edu
## Modified by Thomas Wolf, HuggingFace Inc., Email: thomas@huggingface.co
## Copyright (c) 2017-2018
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this source tree
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"""Encoding Data Parallel"""
@vasanthk
vasanthk / System Design.md
Last active May 6, 2024 01:32
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@calstad
calstad / TDA_resources.md
Last active May 4, 2024 08:11
List of resources for TDA

Quick List of Resources for Topological Data Analysis with Emphasis on Machine Learning

This is just a quick list of resourses on TDA that I put together for @rickasaurus after he was asking for links to papers, books, etc on Twitter and is by no means an exhaustive list.

Survey Papers

Both Carlsson's and Ghrist's survey papers offer a very good introduction to the subject

Other Papers and Web Resources

@tegansnyder
tegansnyder / disable mcafee endpoint protection.md
Last active December 26, 2023 03:18
Disable McAffee Endpoint Protection OSX

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas

alternatively

sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload
@pv
pv / lol.txt
Created July 8, 2013 19:53
Restructured lol
.. |lol1| replace:: lol
.. |lol2| replace:: |lol1| |lol1| |lol1| |lol1| |lol1| |lol1| |lol1| |lol1| |lol1| |lol1| |lol1|
.. |lol3| replace:: |lol2| |lol2| |lol2| |lol2| |lol2| |lol2| |lol2| |lol2| |lol2| |lol2| |lol2|
.. |lol4| replace:: |lol3| |lol3| |lol3| |lol3| |lol3| |lol3| |lol3| |lol3| |lol3| |lol3| |lol3|
.. |lol5| replace:: |lol4| |lol4| |lol4| |lol4| |lol4| |lol4| |lol4| |lol4| |lol4| |lol4| |lol4|
.. |lol6| replace:: |lol5| |lol5| |lol5| |lol5| |lol5| |lol5| |lol5| |lol5| |lol5| |lol5| |lol5|
.. |lol7| replace:: |lol6| |lol6| |lol6| |lol6| |lol6| |lol6| |lol6| |lol6| |lol6| |lol6| |lol6|
.. |lol8| replace:: |lol6| |lol7| |lol7| |lol7| |lol7| |lol7| |lol7| |lol7| |lol7| |lol7| |lol7|
.. |lol9| replace:: |lol6| |lol8| |lol8| |lol8| |lol8| |lol8| |lol8| |lol8| |lol8| |lol8| |lol8|
.. |lol| replace:: |lol9|
@caruccio
caruccio / rh-openshift-rest-api.txt
Last active September 20, 2017 22:33
Summary of RedHat's Openshift RESTfull API
############################################
# Summary of RedHat's Openshift RESTfull API
#
# METHOD PATH PARAMETER_NAME=[VALUE|...] <NAME=[VALUE|...]>
#
# - <...> are optional parameter.
# - VALUE* is the default.
############################################
# Domains
@ehazlett
ehazlett / django_py27_openshift.md
Created April 27, 2012 18:59
Django on Python 2.7 OpenShift

Runtime Configuration

Create a new OpenShift app:

  • rhc-create-app -a <app_name> -t diy-0.1

Login to the application host using the credentials from the above command. It will look like ssh://c8812345:123214@<app_name>-username.rhcloud.com:

  • ssh c8812345:123214@<app_name>-username.rhcloud.com
@vinilios
vinilios / django custom aggregate
Created November 4, 2009 12:11
custom django aggregate
class MyMax(Aggregate):
sql_function = 'CHAR_LENGTH'
"""A base class to make it easy for end users to define their own
custom SQL aggregates.
The subclass should define the following two class properties:
* sql_function - the name of the SQL function to invoke
Optionally, you can define
* sql_template - a format string that is used to compose the
@mnot
mnot / RSS.py
Created October 29, 2009 12:48
RSS.py: work with RSS channels as data structures
#!/usr/bin/env python
"""
RSS.py
Classes for working with RSS channels as arbitrary data structures.
Requires Python 2.2 or newer and PyXML 0.7.1 or newer.
ChannelBase - Base class for RSS Channels.
CollectionChannel - RSS Channel modeled as a URI-per-entry