This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyApp = {}; | |
MyApp.vent = _.extend({}, Backbone.Events); | |
MyApp.vent.on("some:event", function(){ | |
alert("some event was fired!"); | |
}); | |
MyApp.vent.trigger("some:event"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MedicationView = Backbone.View.extend({ | |
events: { | |
"click #edit": "editMedication" | |
}, | |
editMedication: function(){ | |
var editView = new AddEditView({model: this.model}); | |
editView.render(); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Oskar Szrajer | |
email = [email protected] | |
[alias] | |
br = branch | |
co = checkout | |
ci = commit | |
df = diff | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backbone.Collection.prototype.getOrCreate = function(model, options) { | |
var _model; | |
// Ensure model has an id property and attempt to get out of the collection | |
if (model.id && _model = this.get(model.id)) { | |
options && options.success(_model); | |
return _model; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true; do | |
find ./ -regex '.*\.\(mp3\|flac\)' -printf '%T+ %p\n' | sort | head -n 10 | sort --random-sort | while read f; do | |
mplayer -quiet "$f" </dev/tty; | |
touch "$f"; | |
done | |
sleep 1 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive, Output, EventEmitter, HostListener } from '@angular/core'; | |
@Directive({ | |
selector: '[click.stop],[clickStop]' | |
}) | |
export class StopPropagationDirective { | |
@Output("click.stop") stopPropEvent = new EventEmitter(); | |
@HostListener('click', ['$event']) | |
onClick(event: Event) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:8-slim | |
# -------------------------------------- | |
# Install Chrome | |
# -------------------------------------- | |
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | |
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ | |
&& apt-get update \ | |
&& apt-get install -y google-chrome-stable --no-install-recommends |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$MachineName = $env:computername | |
$InstanceName = "SQLEXPRESS" | |
$ServerInstance = "$MachineName\$InstanceName" | |
Get-SqlInstance -ServerInstance $ServerInstance | |
# Provide SQLServerName | |
$SQLServer = "MySQLSErver\InstanceName" | |
# Provide Database Name | |
$DatabaseName = "my-db-name" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
co = checkout | |
ci = commit | |
st = status | |
br = branch | |
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if test -f /etc/profile.d/git-sdk.sh | |
then | |
TITLEPREFIX=SDK-${MSYSTEM#MINGW} | |
else | |
TITLEPREFIX=$MSYSTEM | |
fi | |
PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]' # set window title | |
PS1="$PS1"'\n' # new line | |
# PS1="$PS1"'\[\033[32m\]' # change to green |
OlderNewer