Skip to content

Instantly share code, notes, and snippets.

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

Liel Dulev lieldulev

🏠
Working from home
View GitHub Profile
@lieldulev
lieldulev / readme.md
Created June 1, 2012 03:48
Markdown syntax explained in one file

Markdown Syntax


Is easy to learn and simple to implement

Leave empty line for a new paragraph.

Consecutive lines of text will continue by default, and they will be wrapped

function Person(/* whatever args your gonna have*/) {
this.onSave_ = this.onSave.bind( this );
this.onSetAge_ = this.onSetAge.bind( this );
}
Person.prototype.save = function() {
this.database.insert( this.properties, this.onSave_ );
};
Person.prototype.setAge = function( newAge ) {
this.constructor.validate( "age", this, newAge, this.onSetAge_ );
@xeoncross
xeoncross / ajax.js
Last active August 3, 2023 06:06
Simple, cross-browser Javascript POST/GET xhr request object. Supports request data and proper AJAX headers.
/**
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object
*
* @param string url
* @param object callback
* @param mixed data
* @param null x
*/
function ajax(url, callback, data, x) {
try {
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active November 5, 2024 15:51
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@korya
korya / bug-in-design-zayin-in-debug.md
Created February 11, 2016 17:16
Bug in design, zayin in debug (explanation)

"Bug ba-design, zayin ba-debug" (Hebrew: באג בדיזיין, זין בדיבאג)

I feel sorry for the majority here - non-Israelis who can't get this joke - because it's truly one of the funniest things I've heard in a while. It is a clever play on words, even though it mixes English and Hebrew and isn't all that grammatically correct (it's not even a complete sentence). Remarkably, it is a fact of life as well.

The word zayin (slang for "dick" in Hebrew, pronounced similarly to "sign" in "design") has some of the connotations the word shit has in English. The phrase, therefore, can be translated as "A bug in the design (is) shit in the debugging" or "A bug in the design (is) shit to debug". Another way to interpret this usage of "zayin" is as a shorthand for "lekabel zayin" (lit. "to get dick" - to get screwed; carries very rude connotations), and then a loose translation could be "If there's a bug in the design, you get screwed when you debug".

The original writeup above (which is no longer with us) said this was a com

@milesrichardson
milesrichardson / Tutorial.md
Last active December 1, 2018 22:36
Using `wget --continue` to resume broken downloads from Google Chrome

The Problem

You're downloading a big 1GB SQL file with Chrome. It stalls at 120mb. Ok, you try again. Looks like it's working this time. Thirty minutes later... stalls at 800mb. You are pulling your hair out.

What do?

wget --continue to the rescue!

Assumptions:

@lieldulev
lieldulev / hideZehutFacebookComments.js
Created March 13, 2019 05:03
Hide Zehut Related Comments on Facebook להסתיר תגובות על זהות בפייבסוק
// Copy paste into your chrome console to periodically hide any comments containing זהות.
setInterval(()=>{Array(...document.getElementsByTagName('span')).filter(c=>c.textContent.includes('זהות')).forEach(c=>{c.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.style.display = 'none';});}, 500);
@smhanov
smhanov / OpenType.ts
Last active October 25, 2024 21:20
Here is my implementation of a TrueType font reader in Typescript. You can read a font directly from an ArrayBuffer, and then call drawText() to draw it. See my article http://stevehanov.ca/blog/index.php?id=143. The second file, OpenType.ts is the same thing but it handles more TrueType files. It is also more coplex
// To see this run, you first stub out these imports. Then put the file in a Uint8Array.
// let slice = new Slice(array);
// let font = new OTFFont(slice);
// Then you can call methods like font.drawText(canvasContext, )
//
//
import { ICanvasContext } from "./ICanvasContext"
import { log as Log } from "./log"
const log = Log.create("OPENTYPE");