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 {Animated, Easing, EasingFunction} from 'react-native'; | |
import {useEffect, useRef} from 'react'; | |
const DEFAULT_ANIMATION_DURATION = 300; | |
const DEFAULT_EASING_FUNCTION = Easing.bezier(0.17, 0.67, 0.35, 0.92); | |
export function useBooleanAnimation( | |
value: boolean, | |
{ | |
duration = DEFAULT_ANIMATION_DURATION, |
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
export type ReturnTypes<T> = { | |
[P in keyof T]: T[P] extends (...args: any[]) => any | |
? ReturnType<T[P]> extends PromiseLike<infer U> | |
? U | |
: ReturnType<T[P]> | |
: T[P]; | |
}; |
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 json | |
class BaseDecoder: | |
def __init__(self, clazz): | |
json.JSONDecoder.__init__(self) | |
self.clazz = clazz | |
def decode(self, dct): | |
if type(dct) is str: |
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
function abbreviateIpv6(ip) { | |
var out = ip.replace(/(^|\:)0{1,3}([0-9]+)/g, "$1$2"); | |
out = out.replace(/0(\:0)+/, ":"); | |
out = out.replace(/\:{3,}/g, "::"); | |
if (out === ":") { | |
out = "::"; | |
} | |
return out; | |
} |
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 utils = (function() { | |
var utils = {}, | |
PROPERTY_REGEXP = /^(([a-z_][a-z0-9_]*\.?)+[a-z0-9_]+)$/i; | |
var checkProperty = function(propName) { | |
if(!PROPERTY_REGEXP.test(propName)) | |
throw new Error('Property ' + propName + ' misspelled'); | |
return propName; | |
}; | |
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
util = require 'util' | |
printArgs = (method) -> | |
(args...) -> console.log method, util.inspect(args) | |
# Read a file and redirect it to standart output | |
fs = require 'fs' |
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
package com.neolitec.examples; | |
import org.apache.commons.codec.binary.Base64; | |
import org.apache.commons.lang.StringUtils; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import javax.servlet.*; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
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
@SuppressWarnings({ "unchecked", "rawtypes" }) | |
private int smartCompare(final Object o1, final Object o2, String field, final Class comparable) { | |
try { | |
if (o1 == o2) { | |
return 0; | |
} else if (o1 != null && o2 == null) { | |
return -1; | |
} else if (o1 == null && o2 != null) { | |
return 1; | |
} |
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
package com.hotelbb.crs.utils.mail; | |
import java.io.UnsupportedEncodingException; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import javax.activation.DataHandler; | |
import javax.activation.DataSource; |
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
package Catcher; | |
use strict; | |
use warnings; | |
use Carp; | |
use Carp qw (cluck); | |
use File::Basename; | |
use POSIX qw(strftime); | |
# Nagios error levels |
NewerOlder