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
'use strict'; | |
require('babel/register'); | |
var Hapi = require('hapi'); | |
var db = require('./db'); | |
var serialize = require('serialize-javascript'); | |
var navigateAction = require('flux-router-component').navigateAction; | |
var debug = require('debug')('Example'); | |
var React = require('react'); |
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
window.resolveLocalFileSystemURL(imageUri, function(fileEntry) { | |
fileEntry.file(function(file) { | |
file.name = filename; | |
template.cordovaFile = file; | |
}); | |
}); | |
var file = template.cordovaFile; | |
var reader = new FileReader(); | |
reader.onloadend = function(e) { |
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
# parse cli args | |
for ((i = 1; i <= $#; i + 0)); do | |
read -a tmp <<<${@} | |
if [[ ${!i} =~ ^[-]?[a-z]$ && ${@:((i + 1)):1} =~ ^[^-] ]]; then | |
tmp[i]=${tmp[@]:((i - 1)):1}"="${tmp[i]} | |
set -- ${tmp[*]} | |
fi | |
if [[ ${!i} == "-"* ]]; then # | |
case ${!i} in | |
# flags with args |
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
'use strict'; | |
const Joi = require('joi'); | |
const U = require('./utils'); | |
const Schema = require('./schema'); | |
const Pkg = require('./package.json'); | |
const internals = {}; | |
internals.PLUGIN_NAME = Pkg.name; |
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 { reduce, find } from 'lodash'; | |
import { observable, action, computed, extendObservable } from 'mobx'; | |
import Validator from 'validatorjs'; | |
import en from 'validatorjs/src/lang/en'; | |
Validator.setMessages('en', en); | |
class FormStore { |
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 type { | |
StorageReference, | |
UploadMetadata, | |
UploadTask, | |
} from 'firebase/storage'; | |
import * as React from 'react'; | |
import { ref, uploadBytesResumable, getDownloadURL } from 'firebase/storage'; | |
import { getStorage } from '~/services/firebase'; | |
export enum UploadState { |
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
// Some dll injection code | |
// November 21, 2004 | |
// by SpuN [ http://spun.gamedeception.net ] | |
// injection_thread.cpp | |
DWORD WINAPI InjectionThread(LPVOID lpParam) | |
{ | |
while(1) | |
{ |
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
deploy: | |
name: 🚀 Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🛑 Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.9.1 | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v3 |
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
// credit @colinhacks | |
// https://github.com/remix-run/remix/pull/1254 | |
type JSONPrimitives = string | number | boolean | null; | |
type NonJSONPrimitives = undefined | Function | symbol; | |
export type SerializeType<T> = T extends JSONPrimitives | |
? T | |
: T extends undefined | |
? undefined |
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 type {RefObject} from 'react'; | |
import {useEffect} from 'react'; | |
const defer = (fn: () => void) => setTimeout(fn, 0); | |
export function useCurrentItemScroller(containerRef: RefObject<HTMLElement>) { | |
useEffect(() => { | |
const containerEl = containerRef.current; | |
let observer: MutationObserver | undefined; | |
if (containerEl) { |
OlderNewer