- Read every row in the table
- No reading of index. Reading from indexes is also expensive.
This file contains 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
$ git branch -r --merged | | |
grep origin | | |
grep -v '>' | | |
grep -v master | | |
xargs -L1 | | |
awk '{split($0,a,"/"); print a[2]}' | | |
xargs git push origin --delete |
This file contains 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
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
This file contains 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
SSH agent forwarding is great. It allows you to ssh from one server to | |
another all the while using the ssh-agent running on your local | |
workstation. The benefit is you don't need to generate ssh key pairs | |
on the servers you are connecting to in order to hop around. | |
When you ssh to a remote machine the remote machine talks to your | |
local ssh-agent through the socket referenced by the SSH_AUTH_SOCK | |
environment variable. | |
So you the remote server you can do something like: |
This file contains 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
# replaces this file /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/sane_defaults.rb | |
# NOTE: if using a different Vagrant version, adjust the version field accordingly | |
# NOTE2: only the sections with the IRVING comment have been changed from the default | |
require "log4r" | |
module VagrantPlugins | |
module ProviderVirtualBox | |
module Action | |
class SaneDefaults |
This file contains 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
# sample of a macro that flood the method calls with `#try` | |
# as a POC it does not support methods with arguments | |
macro mtry(expr) | |
{% if expr.is_a?(Call) %} | |
mtry({{expr.receiver}}).try(&.{{expr.name}}) | |
{% else %} | |
{{expr}} | |
{% end %} | |
end |
$ uname -r
This file contains 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
" requires vim 8 for timer support | |
function! UpdatePowerSaving(timerId) | |
if executable('pmset') | |
call system("pmset -g batt | head -1 | grep 'Battery'") | |
if !v:shell_error | |
" on battery | |
let g:ale_lint_delay=10000 | |
else | |
" power adapter |
First download alpine-make-vm-image from https://github.com/alpinelinux/alpine-make-vm-image
wget https://raw.githubusercontent.com/alpinelinux/alpine-make-vm-image/v0.4.0/alpine-make-vm-image \
&& echo '5fb3270e0d665e51b908e1755b40e9c9156917c0 alpine-make-vm-image' | sha1sum -c \
|| exit 1
mv alpine-make-vm-image /usr/local/bin/
chmod +x /usr/local/bin/alpine-make-vm-image
Create a new alpine qcow2 image