Skip to content

Instantly share code, notes, and snippets.

View .vimrc
" Location for installing plugins
call plug#begin('~/.vim/plugged')
" Other plugins are specified with user/repo on Github or x.vim on vimscripts
" Git integration (status bar and commands like Gblame)
Plug 'tpope/vim-fugitive'
" Add info to sidebar about git
Plug 'airblade/vim-gitgutter'
" Add file-management commands like :Delete, :Move, and :Rename
Plug 'tpope/vim-eunuch'
@akemrir
akemrir / web-servers.md
Created May 27, 2020 — forked from willurd/web-servers.md
Big list of http static server one-liners
View web-servers.md

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@akemrir
akemrir / fix-infinality.md
Created Nov 15, 2019 — forked from cryzed/fix-infinality.md
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.
View fix-infinality.md

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@akemrir
akemrir / tableToSql.js
Created Dec 11, 2018 — forked from rnaffer/tableToSql.js
Export table to excel with pure javascript
View tableToSql.js
var tableToExcel = (function() {
var uri = 'data:application/vnd.ms-excel;base64,'
, template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><?xml version="1.0" encoding="UTF-8" standalone="yes"?><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
, base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
, format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) };
return function(table, name) {
if (!table.nodeType) table = document.getElementById(table);
var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML };
window.location.href = uri + base64(format(template, ctx));
};
View gist:8716e81b1b749c410fef
@import "bootstrap/variables"
=respond-to($media)
@if $media == xs
@media (max-width: $screen-xs-max)
@content
@else if $media == sm
@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max)
@content
@else if $media == md
View pacman-key-uzup.sh
#!/bin/bash
for key in FFF979E7 CDFD6BB0 4C7EA887 6AC6A4C2 824B18E8; do
pacman-key --recv-keys $key
pacman-key --lsign-key $key
printf 'trust\n3\nquit\n' | gpg --homedir /etc/pacman.d/gnupg/ \
--no-permission-warning --command-fd 0 --edit-key $key
done
View 960_12_col.sass
$width: 960px
$numCols: 12
$gutterWidth: 10px
$colWidth: ($width/$numCols) - (2*$gutterWidth)
.container_#{$numCols}
margin-left: auto
margin-right: auto
width: $numCols * ($colWidth+(2*$gutterWidth))
View css.sass
=box_gradient($color_stops, $type)// {{{
$firststop: firststop($color_stops)
$laststop: laststop($color_stops)
@if $type == "horizontal"
background: $firststop /* Old browsers */
background: -moz-linear-gradient(left, #{$color_stops}) /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, colorstops(#{$color_stops})) /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #{$color_stops}) /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #{$color_stops}) /* Opera 11.10+ */