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
if (!config.runsInWidget) { | |
return; | |
} | |
const url = `https://api.coronavirus.data.gov.uk/v1/data?filters=areaName=United%2520Kingdom;areaType=overview&structure=%7B%22date%22:%22date%22,%22value%22:%22newCasesByPublishDate%22%7D`; | |
const req = new Request(url); | |
const res = await req.loadJSON(); | |
const chart = { | |
type: "line", |
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
import { print as printGraphQL } from 'graphql-tag/printer'; | |
import RecursiveIterator from 'recursive-iterator'; | |
import objectPath from 'object-path'; | |
export function createNetworkInterface(url) { | |
return { | |
query(request) { | |
const formData = new FormData(); | |
// search for File objects on the request and set it as formData |
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 fs = require('fs'); | |
const keyRegex = /(\[[A-Z\/#0-9]+\])/; | |
if (process.argv.length < 3) { | |
console.error('No file name given.'); | |
process.exit(1); | |
} else { | |
parse(process.argv[2]).then(o => { | |
console.log(o); | |
}); |
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
{ | |
"lon": 6.894092559814453, | |
"lat": 50.272064208984375, | |
"groundSpeed": 499.7942175120898, | |
"heading": 108.9605, | |
"orig": { | |
"lon": -0.461389, | |
"lat": 51.4775, | |
"code": "LHR" | |
}, |
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
NSString *text = @"😀abc🇯🇵"; | |
NSMutableString *convertedText = @"".mutableCopy; | |
[text enumerateSubstringsInRange:NSMakeRange(0,[text length]) options:NSStringEnumerationByComposedCharacterSequences usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { | |
unsigned int i = (unsigned int)*(const UInt32 *)[[substring dataUsingEncoding:NSUTF8StringEncoding] bytes]; | |
if (i > 8436960) { | |
NSData *data = [substring dataUsingEncoding:NSUTF32BigEndianStringEncoding]; | |
NSString *str = [NSString stringWithFormat:@"%@",data]; |
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
// Playground - noun: a place where people can play | |
import UIKit | |
let str = "Test 🇯🇵" | |
var str2 = "" | |
for char in str.unicodeScalars { | |
if (char.value>7936) { | |
str2 += "&#"+String(Int(char.value))+";" |
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
window.fluid.dockBadge = ''; | |
var notify = true; | |
setInterval(updateDockBadge, 500); | |
function updateDockBadge() { | |
var count = document.querySelector(".pls._1r.fwn:not(.hidden_elem)"); | |
if (count) { | |
if (notify) { | |
var title = document.querySelector('._kx ._l2 ._l1').textContent; | |
var text = document.querySelector('._kx ._l3').textContent; |
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
@media (max-width:767px) {} | |
@media (min-width:768px) and (max-width:991px) {} | |
@media (min-width:992px) and (max-width:1199px) {} | |
@media (min-width:1200px) {} | |
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {} |
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
choc ~/.bash_profile | |
alias server="python -m SimpleHTTPServer 8000" |
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 smime -binary -sign -signer ./cert.pem -inkey ./key.pem -in ./manifest.json -out ./signature -outform DER |
NewerOlder