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
const cheerio = require('cheerio') | |
const request = require('request') | |
const { URL } = require('url') | |
const async = require('async') | |
var links = {} | |
fetchAllLinks('https://crawl.codeferret.net/1.html', links, () => { | |
let listLinks = Object.keys(links).map(link => {return `"${link}"`}) | |
console.log(`[\n ${listLinks.join(',\n ')}\n ]`) | |
}) |
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
var http = require('http'); | |
exports.handler = function (event, context) { | |
try { | |
console.log("event.session.application.applicationId=" + event.session.application.applicationId); | |
if (event.session.new) { | |
onSessionStarted({requestId: event.request.requestId}, event.session); |
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.IO; | |
using System.Linq; | |
using Microsoft.AspNetCore.Html; | |
using Newtonsoft.Json; | |
namespace HtmlHelpers | |
{ | |
/// <summary> |
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
task<GeolocationAccessStatus> geolocationAccessRequestTask(Windows::Devices::Geolocation::Geolocator::RequestAccessAsync()); | |
geolocationAccessRequestTask.then([this](task<GeolocationAccessStatus> accessStatusTask) | |
{ | |
// Get will throw an exception if the task was canceled or failed with an error | |
auto accessStatus = accessStatusTask.get(); | |
if (accessStatus == GeolocationAccessStatus::Allowed) | |
{ | |
// LOG: Waiting for update... | |
auto geolocator = ref new Windows::Devices::Geolocation::Geolocator(); |
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
// In jQuery the easy thing to do when to decruft json responses if a javascript has: | |
// | |
// for (;;); {foo: 'bar'} | |
// | |
// Is to decruft it using ajax converters. Example | |
$.ajaxSetup({ | |
converters: { | |
"text json": function(result) { | |
return JSON.parse(result.replace('for (;;);', '')); |
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
<UserControl.Resources> | |
<Storyboard x:Name="StartAnimation"> | |
<DoubleAnimation RepeatBehavior="Forever" Duration="0:0:1" To="360" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="ProgressArc"/> | |
<DoubleAnimation Duration="0:0:0.5" RepeatBehavior="Forever" AutoReverse="True" From="25" To="35" Storyboard.TargetName="IndicatorRing" Storyboard.TargetProperty="StrokeThickness"/> | |
<DoubleAnimation Duration="0:0:0.5" RepeatBehavior="Forever" AutoReverse="True" From="350" To="370" Storyboard.TargetName="IndicatorRing" Storyboard.TargetProperty="Height"/> | |
<DoubleAnimation Duration="0:0:0.5" RepeatBehavior="Forever" AutoReverse="True" From="350" To="370" Storyboard.TargetName="IndicatorRing" Storyboard.TargetProperty="Width"/> | |
</Storyboard> | |
</UserControl.Resources> |
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
// Append the transfer dom to the document. | |
var transferDOM = document.createElement('div'); | |
transferDOM.style.display = 'none'; | |
transferDOM.id = 'transferdom'; | |
document.body.appendChild(transferDOM); | |
function injectScript(fn) { | |
var script = document.createElement('script'); | |
script.appendChild(document.createTextNode('(' + fn + ')();')); | |
document.body.appendChild(script); |
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
<Grid x:Name="LayoutRoot" Background="Transparent" Margin="0,55,0,0"> | |
<Grid Background="White" Margin="0,10,0,0"> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="Auto" /> | |
<RowDefinition Height="*" /> | |
</Grid.RowDefinitions> | |
<StackPanel Grid.Row="0" Margin="20" Background="Transparent"> | |
<TextBlock Text="Listening" FontSize="36" Margin="0"/> | |
</StackPanel> | |
<StackPanel Grid.Row="1" Margin="20" Background="Transparent" VerticalAlignment="Bottom"> |
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
/* <![CDATA[ */ | |
jQuery(document).ready(function() { | |
jQuery("a[class*=fancybox]").fancybox({ | |
'overlayOpacity' : 0.7, | |
'overlayColor' : '#000000', | |
'transitionIn' : 'elastic', | |
'transitionOut' : 'elastic', | |
'easingIn' : 'easeOutBack', | |
'easingOut' : 'easeInBack', | |
'speedIn' : '700', |
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
<html> | |
<!-- | |
// Uses YouTube Live Feeds API: | |
// https://developers.google.com/youtube/2.0/developers_guide_protocol_retrieving_live_events | |
// | |
// Usage: | |
// 1) Copy paste the code below to your page. | |
// 2) Remember to replace your YouTube [USER_NAME] in the last script element to your own, for example, DariaMusk | |
// 3) You can add CSS Style to the first DIV element to make it look pretty and resize it to any size (normal CSS). | |
// |