Skip to content

Instantly share code, notes, and snippets.

View isstaif's full-sized avatar

al-Amjad Tawfiq Isstaif isstaif

View GitHub Profile
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@trevnorris
trevnorris / perf-flame-graph-notes.md
Last active December 24, 2023 05:25
Quick steps of how to create a flame graph using perf

The prep-script.sh will setup the latest Node and install the latest perf version on your Linux box.

When you want to generate the flame graph, run the following (folder locations taken from install script):

sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
@homaily
homaily / gist:8672499
Last active June 30, 2024 05:39
Regex to validate saudi mobile numbers

السلام عليكم ، هذا كود ريجيكس بسيط للتحقق من صحة أرقام الجوالات السعودية ، يقوم الريجيكس بالتحقق من مفتاح الدولة ، مفتاح شركة الإتصالات لضمان صحة النص المدخل .

Hello, this is a simple regex to validate saudi mobile numbers, the code will validate country code, telecome company code and make sure the tested sting is correct .

/^(009665|9665|\+9665|05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7})$/

Regex Breakdown - شرح الكود

@RIAEvangelist
RIAEvangelist / Install Cloud9 on local or remote computer, server, or raspberry pi
Last active June 6, 2023 03:37
This gist will help you install Cloud9 on your local or remote computer, server, or even your raspberry pi. Many people are having issues at the time of this Gist's creation.
Complete installation process:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y python-software-properties python make build-essential g++ curl libssl-dev apache2-utils git libxml2-dev
sudo apt-get update
sudo apt-get upgrade
cd ~
mkdir git
cd ~/git
@fiznool
fiznool / backboneConstructor.js
Created June 6, 2013 09:19
Overriding Backbone Constructor.
Backbone.View.extend({
constructor: function (options) {
// Do stuff before the View has been setup
Backbone.View.apply(this, arguments);
// Do stuff after the View has been setup,
// particularly after `initialize()` has been called
return this;
@jasonmorganson
jasonmorganson / gist:1160591
Created August 21, 2011 13:07
Backbone.js view rendering using weld.js
render: ->
@el.innerHTML = document.querySelector( if @id then '#'+@id else '.'+@className ).innerHTML
weld( @el, @model.attributes )
@
@mumrah
mumrah / gist:477121
Created July 15, 2010 15:37
ObjectId dereferencing in JavaScript for MongoDB
var _deref = function (doc, field, col) {
var oid = ObjectId(doc[field]);
delete doc[field];
doc[field] = db[col].findOne({_id:oid});
return doc;
}
var deref = function(field, collection){
// C-C-C-Closure!!
return function(doc){