Skip to content

Instantly share code, notes, and snippets.

View stavarotti's full-sized avatar

Steve Chikwaya stavarotti

  • Papillion, NE
View GitHub Profile
@stavarotti
stavarotti / select-ember.hbs
Created September 28, 2015 18:31
select element in Ember 2.0 and above.
<select onchange={{action (mut value) value="target.value"}}>
{{#each choices as |choice|}}
<option value={{choice}} selected={{is-equal value choice}}>{{choice}}</option>
{{/each}}
</select>
@stavarotti
stavarotti / ember_view_lookup.js
Created October 8, 2015 05:53
Lookup a view instance in Ember
// < 1.13
Ember.View.views(Ember.guidFor(this))
// 1.13 +
this.container.lookup('-view-registry:main')[Ember.guidFor(this)]
@stavarotti
stavarotti / emberGenerateDynamicRoute.js
Last active October 8, 2015 15:28
generate a dynamic url in Ember
_generateUrl(routeName, dynamicSegments, queryParams) {
const router = this.get('router');
const args = [ routeName ].concat(dynamicSegments);
if (queryParams) {
args.push({ queryParams });
}
const url = router.generate(...args);
@stavarotti
stavarotti / gist:d2571f44cc897eeed4f4
Created December 19, 2015 21:34
Fix permissions
sudo chown -R `whoami` /usr/local/bin
@stavarotti
stavarotti / git_remove_merged_branches.sh
Created January 12, 2016 23:02
Deleted merged branches
git branch --merged | grep -vE "develop|master" | xargs -n 1 git branch -d
{
"always_show_minimap_viewport": true,
"auto_indent": true,
"auto_match_enabled": true,
"bold_folder_labels": true,
"caret_extra_width": 1,
"caret_style": "phase",
"close_windows_when_empty": false,
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"copy_with_empty_selection": false,
:: When calling a PowerShell script, we need to bypass the the default policy which restricts (a good thing) script from running.
PowerShell -Command "if((Get-ExecutionPolicy) -ne 'Unrestricted') { Set-ExecutionPolicy Bypass -Scope Process }" "C:\vm\vmware\win7-startup.ps1"
# Returns true if the vm is running, else false
Function isVmRunning([string]$name) {
# Whether the named vm is running
[bool]$isRunning = $false
# Use `vmrun` to get the list of currently running vms
[string[]]$runningVms = Invoke-Expression "vmrun list"
# Get the number of running VMs
[int16]$numOfRunningVms = $runningVms.Get(0).split(":").Get(1).Trim()

vim-thug-mode

So you want your vim to be straight up aquafina polar bear status? That maraschino cherry gold plated butterscotch library book shit?

Well iight den. Do this.

  1. Holla at your .vimrc/.nvimrc file, and put these plugins in:
Plugin 'pangloss/vim-javascript'
import Ember from 'ember';
export default Ember.Component.extend({
model: [],
hasData: Ember.computed('model', {
get() {
let model = this.get('model');
return !Ember.isEmpty(model) &&
!(Ember.get(model, 'message') === 'no_data');