Skip to content

Instantly share code, notes, and snippets.

View markprzepiora's full-sized avatar
🏠
Working from home

Mark Przepiora markprzepiora

🏠
Working from home
View GitHub Profile
@markprzepiora
markprzepiora / clean-up-boot-partition-ubuntu.md
Created January 5, 2019 00:23 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

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 
reg add HKCU\Software\Classes\CLSID\{3f3f327e-5577-4649-ae6e-6cc43b49bd7e} /ve /t REG_SZ /d "Recent Items" /f
reg add HKCU\Software\Classes\CLSID\{3f3f327e-5577-4649-ae6e-6cc43b49bd7e}\DefaultIcon /ve /t REG_EXPAND_SZ /d "%SystemRoot%\system32\imageres.dll,-117" /f
reg add HKCU\Software\Classes\CLSID\{3f3f327e-5577-4649-ae6e-6cc43b49bd7e} /v System.IsPinnedToNameSpaceTree /t REG_DWORD /d 0x1 /f
reg add HKCU\Software\Classes\CLSID\{3f3f327e-5577-4649-ae6e-6cc43b49bd7e} /v SortOrderIndex /t REG_DWORD /d 0x42 /f
reg add HKCU\Software\Classes\CLSID\{3f3f327e-5577-4649-ae6e-6cc43b49bd7e}\InProcServer32 /ve /t REG_EXPAND_SZ /d %%systemroot%%\system32\shell32.dll /f
reg add HKCU\Software\Classes\CLSID\{3f3f327e-5577-4649-ae6e-6cc43b49bd7e}\Instance /v CLSID /t REG_SZ /d {0E5AAE11-A475-4c5b-AB00-C66DE400274E} /f
reg add HKCU\Software\Classes\CLSID\{3f3f327e-5577-4649-ae6e-6cc43b49bd7e}\Instance\InitPropertyBag /v Attributes /t REG_DWORD /d 0x11 /f
reg add HKCU\Software\Classes\CLSID\{3f3f327e-5577-4649-ae6e-6cc43b49b
class CasePattern
def initialize(arr)
@arr = arr
end
def ===(other_arr)
@arr.zip(other_arr).all?{ |x1, x2| x1 === x2 }
end
module ConstructorContext
psql --dbname=postgres --no-psqlrc -c "DROP DATABASE IF EXISTS app_test;"
psql --dbname=postgres --no-psqlrc -c "CREATE DATABASE app_test;"
psql --dbname=app_test --no-psqlrc -c < db/structure.sql
for n in $(seq 2 $parallel_tests_count); do
(
psql --dbname=postgres --no-psqlrc -c "DROP DATABASE IF EXISTS app_test$n;"
psql --dbname=postgres --no-psqlrc -c "CREATE DATABASE app_test$n WITH TEMPLATE app_test;"
) &
done
# Example:
#
# Content.find_each.with_progress{ |c| do_something(c) }
#
# Will do_something to each content and print out a nice progress bar as it goes
class Enumerator
def with_progress
return to_enum(__callee__) unless block_given?
bar_chars = %w( ▏ ▎ ▍ ▌ ▋ ▊ ▉ )
@markprzepiora
markprzepiora / controllers.application.js
Last active October 18, 2016 17:40
Clicked outside
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
clickOutside(event) {
const $target = Ember.$(event.target);
const clickedOutside = typeof $target.data('outside') !== 'undefined';
alert("Clicked outside: " + (clickedOutside ? "yes" : "no"));
},
import Ember from 'ember';
export default Ember.Controller.extend({
model: null,
actions: {
// This is fired when the user selects a new time zone
// from the dropdown.
changeTimeZone(tz) {
this.set('model.timeZone', tz);
import Ember from 'ember';
export default Ember.Controller.extend({
model: null,
actions: {
// This is fired when the user selects a new time zone
// from the dropdown.
changeTimeZone(tz) {
this.set('model.timeZone', tz);
if [ ! -f Serge\ Lang\ -\ SL2\(R\)\ \(978-1-4612-5142-2\).pdf ]; then
echo "downloading 978-1-4612-5142-2"
curl -L http://link.springer.com/content/pdf/10.1007/978-1-4612-5142-2.pdf > Serge\ Lang\ -\ SL2\(R\)\ \(978-1-4612-5142-2\).pdf.tmp
mv Serge\ Lang\ -\ SL2\(R\)\ \(978-1-4612-5142-2\).pdf{.tmp,}
fi
if [ ! -f David\ Cox\ John\ Little\ Donal\ OShea\ -\ Ideals,\ Varieties,\ and\ Algorithms\ \(978-1-4757-2693-0\).pdf ]; then
echo "downloading 978-1-4757-2693-0"
curl -L http://link.springer.com/content/pdf/10.1007/978-1-4757-2693-0.pdf > David\ Cox\ John\ Little\ Donal\ OShea\ -\ Ideals,\ Varieties,\ and\ Algorithms\ \(978-1-4757-2693-0\).pdf.tmp
mv David\ Cox\ John\ Little\ Donal\ OShea\ -\ Ideals,\ Varieties,\ and\ Algorithms\ \(978-1-4757-2693-0\).pdf{.tmp,}
fi
@markprzepiora
markprzepiora / springer-free-maths-books.md
Created December 29, 2015 16:11 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links