Skip to content

Instantly share code, notes, and snippets.

Stephen Solka trashhalo

Block or report user

Report or block trashhalo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rufo
rufo / .vimrc
Created Jun 2, 2017
Change vim settings settings based on power status
View .vimrc
" 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
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active Sep 20, 2019
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
View clean-up-boot-partition-ubuntu.md

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@bcardiff
bcardiff / mtry.cr
Created Feb 18, 2016
mtry macro for crystal
View mtry.cr
# 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
@scottjacobsen
scottjacobsen / git+clone+ssh+agent+forward+sudo
Created Dec 14, 2012
Git clone using ssh agent forwarding and sudo
View git+clone+ssh+agent+forward+sudo
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:
@Mithrandir0x
Mithrandir0x / gist:3639232
Created Sep 5, 2012
Difference between Service, Factory and Provider in AngularJS
View gist:3639232
// 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!"
@schacon
schacon / gist:942899
Created Apr 26, 2011
delete all remote branches that have already been merged into master
View gist:942899
$ 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
You can’t perform that action at this time.