Skip to content

Instantly share code, notes, and snippets.

View psycalc's full-sized avatar
💭
DevOps Learning

Raziel psycalc

💭
DevOps Learning
View GitHub Profile
@psycalc
psycalc / JSDesignPatternMixin.js
Last active November 3, 2016 07:31
JavaScript Design Pattern Mixin
//--------------------------------------------------------------Simpler Realization-------------------------------------------------------------
function extend(target) {
//if we do not have second argument (zero based)
if(!arguments[1]) {
//do nothing
return;
}
//initial arguments length
var initialArgLength = arguments.length;
for (var i=1, i <intialArgLength; i++ ){
@psycalc
psycalc / symbols.html
Created October 21, 2016 09:43
uah symbol
&#8372;
@psycalc
psycalc / new-website.ps1
Last active June 5, 2018 11:52
powershell WebAdministration (Windows Browser-Sync alternative)
new-website -PhysicalPath "D:\work\testIISPS\" -Name "MySiteName"
# list of all available (added earlier) websites Get-Website
start-website MySiteName
#stop-website
@psycalc
psycalc / title.ps1
Created October 17, 2016 11:16
change powershell window title
$host.ui.RawUI.WindowTitle = "ThisIsTextForPSTitle"
@psycalc
psycalc / menuAutoScroll,.js
Last active September 18, 2016 10:51
menu auto scroll
//dependecy: jQuery
//just scroll to element with data-slice value
function goToByScroll(dataslide) {
//jQuery function animate do that work
var elementWithDataSlideAttr = $('.slide[data-slide="' + dataslide + '"]');
//offset it is object with tho properties left and top (px from the left/top accordingly)
var offsetOfThatElement = elementWithDataSlideAttr.offset();
var configurationPlainObjectForAnimateFunction = {
scrollTop: offsetOfThatElement.top
}
@psycalc
psycalc / checkRepo.ps1
Created September 12, 2016 20:58
check github repo existance powershell
$a = git ls-remote --exit-code https://github.com/designofhumanity/$ProjectName 2>&1
if ($a.Exception)
# {
# $AnswerRepo =Read-Host -Prompt "Create repository on github? 1 - yes, 2 - no"
# If ($AnswerRepo -eq "1") {
# $result =Invoke-RestMethod -Headers $Headers -Uri https://api.github.com/user/repos -Body $Body -Method post | Format-Wide -Property clone_url -Column 1 | out-string
#..................................... and so on
@psycalc
psycalc / gitErrorToPSError.ps1
Created September 12, 2016 19:44
convert git error to powershell error
git status 2>&1
@psycalc
psycalc / wrapperFullHeight.css
Last active September 12, 2016 11:03
wrapper/container height 100% inside body
body, html { /*hack selectors*/
height: 100%; /*hack value!!*/
margin: 0px auto; /* delete margin also works margin: 0px; */
padding: 0px auto; /*delete padding also works padding: 0px*/
}
/**/
.wrapper {
height: auto; /* These two lines were the key. */
min-height: 100%
/*overflow: hidden;*/ /* Do not use this, it crops in small browsers. */
@psycalc
psycalc / atom-google-translate.coffee
Created September 11, 2016 19:17
atom possible google tranlate
url = "https://translate.google.com/?en=en#en/ru/#{cased}"
# Shell.openExternal url
xmlHttp = new XMLHttpRequest()
xmlHttp.open( "GET", url, false )
xmlHttp.onreadystatechange = ->
if this.readyState == 4
parser = new DOMParser()
doc = parser.parseFromString(xmlHttp.responseText, "text/html")
resultbox = doc.getElementById("result_box")
alert(resultbox.innerHTML)
@psycalc
psycalc / eventObjectEqualThis.js
Created September 10, 2016 11:25
event object target equalt this
sometEventHandler (e) {
console.log(e.target === this); // true
//...
}