Skip to content

Instantly share code, notes, and snippets.

View nielsiano's full-sized avatar
💭
(┛ಠ_ಠ)┛彡┻━┻

Niels Stampe nielsiano

💭
(┛ಠ_ಠ)┛彡┻━┻
View GitHub Profile
@nielsiano
nielsiano / numberFormat.php
Last active December 18, 2015 21:39
Format Number: Returns the supplied number with commas and a decimal point. Fixed for Danish Kroner format.
<?php
/**
* Format Number
*
* Returns the supplied number with commas and a decimal point.
* Fixed for Danish Kroner format
*
* @access public
* @return float
@nielsiano
nielsiano / nielsiano.zsh-theme
Created June 28, 2013 15:57
nielsiano oh-my-zsh theme
PROMPT='
%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[green]%}]"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
@nielsiano
nielsiano / .zshrc
Created June 28, 2013 15:59
zshconfig
# Path to oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# name of the theme
# ~/.oh-my-zsh/themes/
ZSH_THEME="nielsiano"
# aliases
alias zshconfig="subl ~/.zshrc"
alias -g subl=sublime
@nielsiano
nielsiano / shaToBcrypt.php
Last active December 19, 2015 03:49
Ion_Auth: Change password from sha1+salt to bcrypt
<?php
/**
* Check if string is sha1
*
* @return bool
* @author Nielsiano
**/
public function is_sha1($password)
{
return preg_match('/^[a-z0-9]{40}$/i', $password);
import sublime
import sublime_plugin
class NumberCommand(sublime_plugin.TextCommand):
def run(self, edit):
selection = self.view.sel()
for region in selection:
try:
value = int(self.view.substr(region))
self.view.replace(edit, region, str(self.op(value)))