Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View myoffe's full-sized avatar
🏠
Working from home

Michael Yoffe myoffe

🏠
Working from home
View GitHub Profile
@myoffe
myoffe / getting-started-with-node-and-why-you-shouldnt.md
Last active May 30, 2018 12:19
Getting started with Node/React... and why you shouldn't

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)

<!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 December 20, 2015 22:08
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
[alias]
curbranch = rev-parse --abbrev-ref HEAD
offset = !git log $(git curbranch)..master
@myoffe
myoffe / useful_yad2.js
Created June 28, 2013 23:27
Slightly modified version of Useful Yad2 (http://userscripts.org/scripts/show/170275) to work with all Nadlan pages.
// ==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 March 11, 2011 19:35
Normalize whitespace in string
def normalize_whitespace(str):
import re
str = str.strip()
str = re.sub(r'\s+', ' ', str)
return str
@myoffe
myoffe / split_django_models.py
Created March 11, 2011 19:34
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 :