Skip to content

Instantly share code, notes, and snippets.

View roartalent's full-sized avatar

P roartalent

View GitHub Profile
@roartalent
roartalent / ntlm.js
Created September 4, 2017 23:44 — forked from andypols/ntlm.js
Javascript to create the type1, type3 messages you need to communicate with an ntlm server. I used this to talk to a NTLM enabled windows server from a node.js application.
var url = require('url');
var crypto = require('crypto');
/*
NTLM PROCESS FOR GET REQUESTS:
==============================
STEP 1: The Client requests a protected resource from the server
STEP 2: The Server responds with a 401 status, with a header indicating that the client must authenticate
STEP 3: The Client resubmits the request with an Authorization header containing a Base-64 encoded Type 1 message. From this point forward, the connection is kept open; closing the connection requires reauthentication of subsequent requests.
@roartalent
roartalent / silverstripe_duplicate_relations.php
Created July 7, 2016 23:22 — forked from gherkins/silverstripe_duplicate_relations.php
Silverstripe – has_many- and many_many-relations when duplicating pages
<?php
public function duplicate() {
$items_to_duplicate = array(
'Images',
'Somehting'
);
$page = parent::duplicate();
@roartalent
roartalent / .bash_profile
Created August 31, 2015 09:21
bash_profile
# Reset
Color_Off="\[\033[0m\]" # Text Reset
# Regular Colors
Black="\[\033[0;30m\]" # Black
Red="\[\033[0;31m\]" # Red
Green="\[\033[0;32m\]" # Green
Yellow="\[\033[0;33m\]" # Yellow
Blue="\[\033[0;34m\]" # Blue
Purple="\[\033[0;35m\]" # Purple
@roartalent
roartalent / Sublime preference settings
Last active August 29, 2015 14:17
My sublime preference settings
{
"bold_folder_labels": true,
"color_scheme": "Packages/Theme - Brogrammer/brogrammer.tmTheme",
"detect_indentation": true,
"draw_white_space": "all",
"file_exclude_patterns":
[
"*.sublime-project",
"*.sublime-workspace",
"*.tmLanguage.cache",
@roartalent
roartalent / Bash aliases
Last active August 29, 2015 14:17
Some common commands I use on git bash (windows)
#common bash commands
alias cl='clear'
alias ll='ls -lah'
#programs <replace with your sublme path>
alias subl='"/c/dev/programs/Sublime Text 3/sublime_text.exe"'
#### git commands ####
alias gt='git'