This file contains hidden or 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
| async function parse() { | |
| const feedparser = require('feedparser-promised'); | |
| const feedUrl = 'https://blogs.msdn.microsoft.com/appserviceteam/feed/'; | |
| let items = await feedparser.parse(feedUrl); | |
| let title = items[0].title; | |
| let date = Date.parse(items[0].pubDate); | |
| let hoursDelta = Math.floor(date / 1000 / 60); | |
| let daysDelta = hoursDelta % 24; | |
| let result = `Here is the title of the most recent blog post: ${title}. ` + |
This file contains hidden or 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
| $.ajax({ | |
| url: "destination url", | |
| success: ..., | |
| error: ..., | |
| // shows the loader element before sending. | |
| beforeSend: function () { | |
| $("#imgSpinner1").show(); | |
| }, | |
| // hides the loader after completion of request, whether successfull or failor. | |
| complete: function () { |
This file contains hidden or 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.Linq; | |
| using System.Net; | |
| using System.Web.Http; | |
| using OpenQA.Selenium; | |
| using OpenQA.Selenium.PhantomJS; | |
| using OpenQA.Selenium.Support.UI; | |
| namespace WebRole1.Controllers |
This file contains hidden or 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
| openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem | |
| openssl pkcs12 -inkey key.pem -in certificate.pem -export -out certificate.pfx | |
| #dump cert info: | |
| openssl x509 -text -noout -in certificate.pem | |
| openssl x509 -serial -fingerprint -noout -in certificate.pem |
This file contains hidden or 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
| // https://chr4.org/blog/2017/03/15/cross-compile-and-link-a-static-binary-on-macos-for-linux-with-cargo-and-rust/ | |
| // | |
| // cargo new projectname | |
| // | |
| // Cargo.toml: | |
| // | |
| // [package] | |
| // name = "webreq" | |
| // version = "0.1.0" | |
| // authors = ["snobu <foo@xxxxx.zzz>"] |
This file contains hidden or 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
| // FIT LAYER TO CANVAS | |
| // via https://forums.adobe.com/message/5413957#5413957 | |
| var maintainAspectRatio = true; // set to true to keep aspect ratio | |
| if (app.documents.length>0){ | |
| app.activeDocument.suspendHistory ('Fit Layer to Canvas', 'FitLayerToCanvas('+maintainAspectRatio+')'); | |
| } | |
| function FitLayerToCanvas(keepAspect) { |
This file contains hidden or 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
| $result = 1; foreach ($number in 1..[int32]::MaxValue) { $result = $result * $number } |
This file contains hidden or 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
| https://stackoverflow.com/a/36158802/4148708 |
This file contains hidden or 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
| extern crate termion; | |
| extern crate tui; | |
| mod util; | |
| use util::*; | |
| use std::io; | |
| use std::thread; | |
| use std::time; | |
| use std::sync::mpsc; |
This file contains hidden or 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
| hdmi_group=2 | |
| hdmi_mode=87 | |
| hdmi_cvt=2560 1440 60 3 0 0 1 | |
| max_framebuffer_width=2560 | |
| max_framebuffer_height=1440 | |
| hdmi_pixel_freq_limit=400000000 |