Skip to content

Instantly share code, notes, and snippets.

View pinpox's full-sized avatar
🤔

Pablo Ovelleiro Corral pinpox

🤔
View GitHub Profile
@splaspood
splaspood / bash_iniparse.sh
Created December 13, 2011 20:34
Parsing INI Files with Bash
cfg.parser () {
fixed_file=$(cat $1 | sed 's/ = /=/g') # fix ' = ' to be '='
IFS=$'\n' && ini=( $fixed_file ) # convert to line-array
ini=( ${ini[*]//;*/} ) # remove comments
ini=( ${ini[*]/#[/\}$'\n'cfg.section.} ) # set section prefix
ini=( ${ini[*]/%]/ \(} ) # convert text2function (1)
ini=( ${ini[*]/=/=\( } ) # convert item to array
ini=( ${ini[*]/%/ \)} ) # close array parenthesis
ini=( ${ini[*]/%\( \)/\(\) \{} ) # convert text2function (2)
ini=( ${ini[*]/%\} \)/\}} ) # remove extra parenthesis
@deekayen
deekayen / workman.php
Created November 16, 2012 07:37
Test input text files using Workman key cap scores
<?php
// EDIT MY PATH
$file = strtolower(file_get_contents('/Users/YOURUSER/Sites/TEST_TEST.txt'));
function get_points($layout = 'Norman') {
switch ($layout) {
case 'QWERTY':
$points[1] = array('s', 'd', 'f', 'j', 'k', 'l');
@martijnvermaat
martijnvermaat / nixos.md
Last active July 13, 2024 09:08
Installation of NixOS with encrypted root
@pr1ntf
pr1ntf / droid-yabs.sh
Last active January 29, 2019 20:55
Booting Android-x86 under FreeBSD bhyve (Work in progress)
#!/bin/sh
# Yet Another bhyve Script v0.3
# Use this example to boot Android-x86
# Have not tested e1000 network emulation yet
# It will install to hd, but will get stuck in boot loop
# This should get you through the setup in live mode
# Be sure to kldload vmm
name=droid86
@pinpox
pinpox / .zshrc
Created February 16, 2017 14:52
# http://bit.do/zshconfig
# https://ptpb.pw/MCeR
#
# Prevents grep options deprecation message
alias grep="/usr/bin/grep --color=auto $GREP_OPTIONS"
unset GREP_OPTIONS
HISTFILE=~/.histfile
HISTSIZE=10000
@corpix
corpix / numbers.nix
Last active July 19, 2024 22:06
pow, decimal to hex, hex to decimal in nix language
{ lib }:
with lib; rec {
pow =
let
pow' = base: exponent: value:
# FIXME: It will silently overflow on values > 2**62 :(
# The value will become negative or zero in this case
if exponent == 0
then 1
else if exponent <= 1
@jackkinsella
jackkinsella / .vimrc
Created February 5, 2020 11:17
.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'
@pinpox
pinpox / grid-flex-a-12-column-grid-using-flexbox.markdown
Created July 22, 2022 23:49
Grid : Flex - A 12-column grid using flexbox

Grid : Flex - A 12-column grid using flexbox

Grid : Flex is a dead-simple, bare bones grid to help you get your layouts looking sharp very quickly. It only cares about laying out your content, so you can style your website or application however you like, without having to worry about creating a custom grid system.

A Pen by Pablo on CodePen.

License.