Skip to content

Instantly share code, notes, and snippets.

View morion4000's full-sized avatar

Ionut Moraru morion4000

View GitHub Profile
@morion4000
morion4000 / count_files_lines.sh
Created July 3, 2014 14:52
Count recursively the number of lines in files
find . -name '*.js' -not -path "./node_modules/*" | xargs wc -l
@morion4000
morion4000 / countdown.py
Created October 10, 2012 15:33
Python countdown to date script
from datetime import datetime, time
def dateDiffInSeconds(date1, date2):
timedelta = date2 - date1
return timedelta.days * 24 * 3600 + timedelta.seconds
def daysHoursMinutesSecondsFromSeconds(seconds):
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
days, hours = divmod(hours, 24)
@morion4000
morion4000 / Usage.js
Created September 18, 2012 19:35
Titanium commonjs module for Youtube
var Youtube = require('Youtube');
var youtube = new Youtube();
var youtubeId = 'HQ1z0Zzqg5U';
youtube.h264videosWithYoutubeURL(youtubeId, function(e) {
videoPlayer.url = e.medium;
}, function(e) {
alert(JSON.stringify(e));
});
var search = Titanium.UI.createSearchBar({
barColor:'#000',
showCancel:true,
height:43,
top:0
});
var tableView = Titanium.UI.createTableView({
top:40,
data:{title:'Please perform a search'}