Skip to content

Instantly share code, notes, and snippets.

@gabrielmiller
gabrielmiller / gist:7538755
Last active December 28, 2015 17:49
angular service
// ----------------
// app.js
// ----------------
var myApp = angular.module('myApp', ['ngRoute','myControllers','myServices']);
myApp.config(['$routeProvider',
function($routeProvider, authentication) {
$routeProvider.when('/', {
authentication: false,
@gabrielmiller
gabrielmiller / balls.js
Created January 2, 2014 20:04
API Request Filter Object Variations
// "$and" and "$in"
{ "$and" : [
{ "projob.job.department" :
{ "$in" :
[ "Engineering", "Marketing" ]
}
},
{ "projob.rating" : {
"$in" :
[ 3, 4, 5 ]
$http({
method: 'POST',
url: 'http://localhost:8000',
data: parameters
})
.success(function(data, status, headers, config){
var Headers = headers();
console.log(Headers);
})
.error(function(data, status, headers, config){
<html>
<head>
<title>Periods in object keys</title>
</head>
<body ng-app="example" ng-controller="exampleController">
<h1>Array with periods in its objects' keys</h1>
<input type="text" ng-model="someInput['a.word']"></input>
<ul>
<li ng-repeat="(itemKey, item) in data | filter: someInput">
Vagrant.configure("2") do |config|
config.vm.box = "raring64"
config.vm.box_url = "http://cloud-images.ubuntu.com/raring/current/raring-server-cloudimg-vagrant-amd64-disk1.box"
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "512"]
end
config.vm.synced_folder ".", "/srv"
#!/bin/bash
workdir="" # <<< PWD of project to default search
if [ "$1" != "" ] && [ "$2" != "" ]; then
$GOPATH/src/github.com/monochromegane/the_platinum_searcher/the_platinum_searcher -i -C 3 "$1" "$2"
else
if [ "$1" != "" ]; then
$GOPATH/src/github.com/monochromegane/the_platinum_searcher/the_platinum_searcher -i -C 3 "$1" $workdir
fi
fi
@gabrielmiller
gabrielmiller / gist:b29423113e6a5064a2b0
Last active August 29, 2015 14:06
Directive nesting and scope issues
/**
* There are two directives and two routes. On route 1 the child directive is used directly in the
* view.
* On route 2 the child directive is used inside of the parent directive which is used directly in the
* view.
* In route 1, the controller for the view has a variable that is bidirectionally bound into the child
* controller.
* When the page variable is manipulated from the view's controller as well as inside the child
* directive, the changes are updated in both controller and directive controller.
* In route 2, the link function of the parent directive has a variable that is bidirectionally bound
@gabrielmiller
gabrielmiller / gist:c750d3c231c8673683d0
Last active August 29, 2015 14:07
AngularJS URL Parser Service
/**
* @ngdoc service
* @name utilityService
* @description Contains utility methods for formatting
* @requires $interpolate
*/
angular.module('resApp').factory('utilityService', function($interpolate) {
/**
* @ngdoc method
\[\033[01;33m\]\u\[\033[01;37m\]@\[\033[01;31m\]beryllium \[\033[01;37m\][\[\033[01;34m\]\W\[\033[01;37m\]]\[\033[00;37m\] >
@gabrielmiller
gabrielmiller / directions.md
Last active February 14, 2021 04:23
up2414q 60hz linux config

Before following these directions you may need to have xrandr 1.5.0, the first version to have virtual displays.

  1. Use xrandr to get a list of displays(xrandr -q) as well as of monitors(xrandr --listmonitors or --listactivemonitors). In this scenario my up2414q showed up as two panels, DP-1-8 and DP-1-9

  2. Create a virtual display with them in order to have them functionally work as one display

    xrandr --setmonitor 24inch auto DP-1-8,DP-1-9

More documentation on xrandr, beyond just manpages, can be found here: http://www.straightrunning.com/tools/xrandr.html#sect3