Skip to content

Instantly share code, notes, and snippets.

Michael Yoffe myoffe

Block or report user

Report or block myoffe

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
@myoffe
myoffe / getting-started-with-node-and-why-you-shouldnt.md
Last active May 30, 2018
Getting started with Node/React... and why you shouldn't
View getting-started-with-node-and-why-you-shouldnt.md

Getting started with Node... and why you shouldn't.

This is originally an email that I wrote to a developer friend of mind, in response for his request for my experiences and advice regarding working with Node for a few months.

I wrote it at a time that I should have been sleeping, but I couldn't, because I was too excited/nervous for my upcoming A1 driving test.

Who am I?

I'm a software developer with 10 years of experience of shipping stuff in Java, Python, C++, Objective-C and now Node.

Node and Java (and Kotlin)

View internal_iframe_event_receive.html
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$('a').click(function(){
alert('Close button is clicked or click is triggered');
});
var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
@myoffe
myoffe / .gitconfig
Last active Dec 20, 2015
Send OSX notifications during the day to remind you how much your branch is lagging behind master. WIP: doesn't work. Trying to migrate to launchd plist
View .gitconfig
[alias]
curbranch = rev-parse --abbrev-ref HEAD
offset = !git log $(git curbranch)..master
@myoffe
myoffe / useful_yad2.js
Created Jun 28, 2013
Slightly modified version of Useful Yad2 (http://userscripts.org/scripts/show/170275) to work with all Nadlan pages.
View useful_yad2.js
// ==UserScript==
// @name A Bit More Useful Yad2
// @match http://www.yad2.co.il/Nadlan/*.php*
// @version 0.3
// ==/UserScript==
/*
* Slightly modified version of Useful Yad2 [http://userscripts.org/scripts/show/170275]
* to work with all Nadlan pages.
*/
@myoffe
myoffe / normalize_whitespace.py
Created Mar 11, 2011
Normalize whitespace in string
View normalize_whitespace.py
def normalize_whitespace(str):
import re
str = str.strip()
str = re.sub(r'\s+', ' ', str)
return str
@myoffe
myoffe / split_django_models.py
Created Mar 11, 2011
Split Django models.py
View split_django_models.py
# 1. Create a models folder under myApp.
# 2. Delete models.py and add a model_name.py file in the models folder for each model model_name.
# 3. Add the following to each model file :
class Meta:
app_label = 'myApp'
# 4. Add a line in models/_init__.py_ for each model file :
You can’t perform that action at this time.