Skip to content

Instantly share code, notes, and snippets.

@nilsoberg2
nilsoberg2 / container.php
Created February 8, 2023 21:56 — forked from tlikai/container.php
PHP Dependency Injection Container
<?php
class Container
{
protected $setings = array();
public function set($abstract, $concrete = null)
{
if ($concrete === null) {
$concrete = $abstract;
@nilsoberg2
nilsoberg2 / Tomorrow-Night.vim
Created December 9, 2019 07:21
My version of Tomorrow-Night.vim
" Tomorrow Night - Full Colour and 256 Colour
" http://chriskempson.com
"
" Hex colour conversion functions borrowed from the theme "Desert256""
" Default GUI Colours
let s:foreground = "c5c8c6"
let s:background = "1d1f21"
let s:selection = "373b41"
let s:line = "282a2e"
@nilsoberg2
nilsoberg2 / .vimrc
Last active September 21, 2021 14:43
My .vimrc with color and keyboard shortcuts
set nocompatible
colorscheme Tomorrow-Night
set number
"set lines=35 columns=150
"let mapleader=" "
"map <leader>s :source ~/.vimrc<CR>
@nilsoberg2
nilsoberg2 / .bash_profile
Last active October 20, 2021 19:55
My .bash_profile with aliases and git branch info
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
@nilsoberg2
nilsoberg2 / sysinfo.pl
Last active October 4, 2019 16:52 — forked from aras-p/sysinfo.pl
Perl get hardware/OS data without non-standard modules
# CPU freq is unreliable on some CPU ('Intel(R) Xeon(R) CPU E5-2690 v3 @ 2.60GHz') since the CPU frequency is adaptive to system load.
my $spec = Util::System::getSystemSpec();
print "OS: '$spec->{os}'\n";
print "CPU: '$spec->{cpu_name}'\n";
print "CPU count: $spec->{num_cpu}\n";
print "CPU freq: $spec->{cpu_freq} GHz\n";