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
var previousHeight, currentHeight=0; | |
while(previousHeight !== currentHeight) { | |
previousHeight = currentHeight; | |
var currentHeight = yield nightmare.evaluate(function() { | |
return document.body.scrollHeight; | |
}); | |
yield nightmare.scrollTo(currentHeight, 0) | |
.wait(3000); | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace Validation | |
{ | |
public class AddressComponent { | |
public string long_name { get; set; } | |
public string short_name { get; set; } | |
public List<string> types { get; set; } |
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
public static class Extensions{ | |
/** | |
* Rounds the supplied number to the nearest multiple of the parameter | |
* @param this int The number to round | |
* @param int The multiple to use | |
* @return int | |
* @static | |
* @extension | |
*/ |
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
public static class TerrainMath{ | |
/** | |
* Gets the XBase and width based on bounds input | |
* @param portalBounds The bounds of the Box collider to use | |
* @param terrainBounds The bounds of the terrain collider to use | |
* @return Vector2 Where X is the XBase and Y is the Width | |
* @static | |
*/ | |
public static Vector2 GetXBaseAndWidth(Bounds portalBounds, Bounds terrainBounds){ |
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/bash | |
mysqldump -u root -p[PASSWORD] --all-databases | gzip > /PATH/TO/STORE/BACKUP/mysqldb_`date +%F`.sql.gz |
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
Name: restrictInput | |
Signature: restrictInput(string type, event keypress); | |
Description: Restricts input to fields to specified values | |
Usage: $("#myfieldID").keydown(function(e)){ | |
restrictInput("alpha",e); | |
}; | |
Types: | |
alphanumeric - All letters and numbers |
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
$("selector").keydown(function (e) { | |
// backspace, delete, tab, escape, enter and . | |
if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 || | |
// Ctrl+A, Command+A | |
(e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) || | |
// home, end, left, right, down, up | |
(e.keyCode >= 35 && e.keyCode <= 40)) { | |
return; | |
} | |
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
// Thanks to Michael Rush for the original version of this rule (https://software-development.dfstudio.com/youtracks-new-javascript-workflows-make-slack-integration-a-breeze-d3275605d565) | |
// IMPORTANT: Use a valid Incoming Webhook from Slack. To get one, go to https://my.slack.com/services/new/incoming-webhook/ | |
var SLACK_WEBHOOK_URL = 'WEBHOOKURL'; | |
var entities = require('@jetbrains/youtrack-scripting-api/entities'); | |
var http = require('@jetbrains/youtrack-scripting-api/http'); | |
var workflow = require('@jetbrains/youtrack-scripting-api/workflow'); | |
exports.rule = entities.Issue.onChange({ |
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
public class Imager : IDisposable{ | |
private string _persist = "NO"; | |
private Process _networkMap; | |
public void Dispose() | |
{ | |
_networkMap.Close(); | |
} | |
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
public static bool CalcIsPrime(dynamic number,out dynamic failure) | |
{ | |
failure = 0; | |
if (number == 1) return false; | |
if (number == 2) return true; | |
if (number % 2 == 0) return false; | |
for (dynamic i = 2; i < (number/2); i++) | |
{ |