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
// JSON to Uint8Array parsing and visa versa | |
// (Intended Bluetooth communication on Cordova) | |
var JsonToArray = function(json) | |
{ | |
var str = JSON.stringify(json, null, 0); | |
var ret = new Uint8Array(str.length); | |
for (var i = 0; i < str.length; i++) { | |
ret[i] = str.charCodeAt(i); | |
} |
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
describe('matchesPath', () => { | |
const matches = [ | |
['/cake', '/cake'], | |
['/cake', '/cake/'], | |
['/cake', '/cake?frige=warm'], | |
['/cake', '/cake?frige=warm&freezer=cold'], | |
['/[id]', '/cake'], | |
['/[anything-goes]', '/cake'], | |
['/c/[id]/practitioner/[pid]/[anything-goes]', '/c/1/practitioner/2/3'], | |
['/[...rest]', '/cake'], |
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"?> | |
<DocuSignEnvelopeInformation xmlns:xsd="http://www.w3.org/2001/XMLSchema" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://www.docusign.net/API/3.0"> | |
<EnvelopeStatus> | |
<RecipientStatuses> | |
<RecipientStatus> | |
<Type>Signer</Type> | |
<Email>tomas@echo.com</Email> | |
<UserName>Tomas Fagerbekk</UserName> |
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
from celery import shared_task | |
from django.db import models, transaction | |
from django.utils import timezone | |
from django_elasticsearch_dsl.apps import DEDConfig | |
from django_elasticsearch_dsl.registries import registry | |
from django_elasticsearch_dsl.signals import BaseSignalProcessor | |
from .. import utils |
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
// autogenerated from Lago database model (https://github.com/getlago/lago) | |
generator client { | |
provider = "prisma-client-js" | |
} | |
datasource db { | |
provider = "postgresql" | |
url = env("DATABASE_URL") | |
} |
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
{ | |
"slides": "https://docs.google.com/presentation/d/1WyicsfMJirQDpJYTVOFwRxwiwgfAVq6fRyylFXc6_G4/edit?usp=sharing", | |
"date": "September 2012" | |
} |
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
/* | |
jscodeshift transform: adds the '.js' extension | |
to all import declarations with relative specifiers: | |
From './file' to './file.js', and | |
from '../file' to '../file.js'. | |
*/ | |
module.exports = function (fileInfo, api) { |
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
/* | |
* Walks a directory (fs.readdir but recursively) | |
* Context: | |
* - fs does not have support for walk/readdir recursively | |
* - fs-extra moved "walk" functionality to https://github.com/jprichardson/node-klaw | |
*/ | |
export const listDirectory = async ( | |
currentPath: string, | |
includeDirectories = false, |
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
from django.utils.text import compress_string | |
from django.core.serializers.json import DjangoJSONEncoder | |
class CompressedBinaryField(models.BinaryField): | |
compress = compress_string | |
@staticmethod | |
def uncompress(s): | |
zbuf = io.BytesIO(s) |
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
# This file is your Lambda function | |
import json | |
def mirror_query_strings(event, context): | |
body = { | |
"queryStrings": event['queryStringParameters'] | |
} | |
return { | |
"statusCode": 200, |
NewerOlder