Top HN posts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Example taken from http://www.webgeekly.com/tutorials/php/how-to-create-a-singleton-class-in-php/ **/ | |
class User | |
{ | |
// Hold an instance of the class | |
private static $instance; | |
// The singleton method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This file is for your main application css. */ | |
@import "../node_modules/nprogress/nprogress.css"; | |
@import "tailwindcss/base"; | |
@import "tailwindcss/components"; | |
@import "./custom.css"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""""""""""""""""""""""""""""""""""" | |
" Allan MacGregor Vimrc configuration | |
""""""""""""""""""""""""""""""""""""" | |
set nocompatible | |
syntax on | |
set nowrap | |
set encoding=utf8 | |
"""" START Vundle Configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Configure the workspaces | |
for monitor in $(bspc query -M); do | |
bspc monitor $monitor -d 1 2 3 4 5 6 7 8 9 | |
done | |
sxhkd &> /var/log/sxhkd.log & | |
bspc config border_width 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
plugins: { | |
"postcss-import": {}, | |
tailwindcss: {}, | |
autoprefixer: {}, | |
"postcss-nested": {} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule UniqueStrings do | |
@moduledoc """ | |
Combinatronics exercise | |
reference: https://www.codewars.com/kata/586c7cd3b98de02ef60001ab/train/elixir | |
Goal: Calculate permutations without repetition | |
Formula: P(n,r)=n!(n−r)! | |
""" | |
def uniq_count(string) do | |
string = String.upcase(string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$installer = $this; | |
$installer->startSetup(); | |
/** | |
* Create Registry Type Table | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class StockItem { | |
private $quantity; | |
private $status; | |
public function __construct($quantity, $status){ | |
$this->quantity = $quantity; | |
$this->status = $status; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class StockItem { | |
private $quantity; | |
private $status; | |
public function __construct($quantity, $status){ | |
$this->quantity = $quantity; | |
$this->status = $status; |
NewerOlder