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
function isNakedDay() { | |
const now = new Date(); | |
const year = now.getFullYear(); | |
const start = new Date(year, 3, 24, -14, 0, 0).getTime() / 1000; | |
const end = new Date(year, 3, 24, 36, 0, 0).getTime() / 1000; | |
const z = now.getTimezoneOffset() * 60; | |
const currentTime = now.getTime() / 1000 - z; | |
return currentTime >= start && currentTime <= end; | |
} |
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
export default function PageLaout ({ html, state }) { | |
const { attrs = {} } = state | |
const { mobileBreakpoint = '40rem', desktopBreakpoint = '60rem' } = attrs | |
return html` | |
<style> | |
:host { | |
min-height: 100vh; | |
display: grid; | |
grid-template-areas: | |
'header' |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.testapp" | |
android:versionCode="1" | |
android:versionName="1.0"> | |
<uses-sdk android:minSdkVersion="7" /> | |
<supports-screens | |
android:largeScreens="true" | |
android:normalScreens="true" | |
android:smallScreens="true" |
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
const path = require('path') | |
const { readFileSync } = require('fs') | |
exports.handler = async function http (req) { | |
let here = path.dirname('.') | |
let postsFilePath = path.join(here, 'rss.xml.br') | |
let posts = readFileSync(postsFilePath, 'binary') | |
console.log(posts.length) |
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
import Meg from 'megalodon' | |
const { default: generator } = Meg | |
// switch to your mastodon server | |
const BASE_URL = 'https://mastodon.online/' | |
const access_token = process.env.MASTODON_TOKEN | |
export async function handler (event) { | |
const {title, link, description} = JSON.parse(event.Records[0].Sns.Message) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" charset="utf-8" src="cordova.android.js"></script> | |
<script type="text/javascript" charset="utf-8" src="ipaddress.js"></script> | |
<script> | |
function init(){ | |
console.log("GOT AN ONLOAD!!!") | |
document.addEventListener("deviceready", deviceReady, true); | |
} |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<title>PhoneGap Events Example</title> | |
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.5.js"></script> | |
<script type="text/javascript" charset="utf-8" src="tts.js"></script> | |
<script type="text/javascript" charset="utf-8"> |
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
function owenv() { | |
bold=$(tput bold) | |
normal=$(tput sgr0) | |
switches="" | |
space=$1 | |
case "$space" in | |
"cloudshell") | |
host=runtime.adobe.io | |
key=<api key> |
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
const fetch = require('node-fetch'); | |
const credentials = require('./credentials'); | |
module.exports = async function(context, req) { | |
if (req.query.searchTerm || (req.body && req.body.searchTerm)) { | |
const searchTerm = req.query.searchTerm || | |
req.body.searchTerm; | |
let url = `http://api.wolframalpha.com/v2/query?input=${searchTerm}&appid=${ | |
credentials.wolfram | |
}`; |
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
const fetch = require('node-fetch'); | |
const credentials = require('./credentials'); | |
module.exports = async function(context, req) { | |
if (req.query.searchTerm || (req.body && req.body.searchTerm)) { | |
const searchTerm = req.query.searchTerm || | |
req.body.searchTerm; | |
let url = `https://www.googleapis.com/language/translate/v2?key=${ | |
credentials.google | |
}&source=en&target=fr&q=${searchTerm}`; |
NewerOlder