A simple sandbox for your webapp. Includes hooks on dom ready, pubsub pattern and much more.
Requires jQuery 1.7+.
#Source
/**
window.onscroll = function() { | |
var top = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop; | |
console.log(top); | |
} |
namespace HipChatter.Libs | |
{ | |
public sealed class API | |
{ | |
private static readonly API instance = new API(); | |
public ObservableCollection<Contact> Contacts = new ObservableCollection<Contact>(); | |
public ObservableCollection<Room> Rooms = new ObservableCollection<Room>(); | |
public ObservableCollection<Chat> Chats = new ObservableCollection<Chat>(); | |
Layer = | |
getCollections: (callback) -> | |
collections = db.extractCollections() | |
return callback(collections) if collections.length | |
API.getCollections | |
success: (data) -> | |
collections = db.saveAndGetCollections data |
<?php | |
$GLOBALS['__DB'] = false; | |
function collection($name = FALSE) | |
{ | |
if (!$GLOBALS['__DB']) | |
{ | |
$connection = new MongoClient("http://localhost:27017"); | |
$dbname = "database_name"; |
# Fetch all the branches and their commits from the repo | |
git fetch origin | |
# Just fetch the branches from the repo | |
git fetch -p | |
# Display the remote branches | |
git branch -r | |
# Setting a local branch remote to the one on the origin |
[ | |
{ | |
"$match": { | |
"tags": { | |
"$in": [ | |
"android", | |
"apple" | |
] | |
} | |
} |
var pages = [ | |
{id: 1, parent: null, name: 'First'}, | |
{id: 2, parent: null, name: 'Second'}, | |
{id: 3, parent: 2, name: 'First child of second'}, | |
{id: 4, parent: 2, name: 'Second child of second'}, | |
{id: 5, parent: 2}, | |
{id: 6, parent: 4}, | |
{id: 7, parent: 4}, | |
{id: 8, parent: 6} | |
]; |
# Search for a string in files | |
grep -r "findme" . | |
# List processes filtered by a string | |
ps -aux | grep httpd |