Skip to content

Instantly share code, notes, and snippets.

View olamedia's full-sized avatar
:octocat:
Working from home

olamedia olamedia

:octocat:
Working from home
  • Russian Federation
View GitHub Profile
@olamedia
olamedia / icu-config
Created October 20, 2020 03:25 — forked from jasny/icu-config
ICU 66.1 for Ubuntu 20.04
#!/bin/sh
## -*-sh-*-
#set -x
# BEGIN of icu-config-top
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#******************************************************************************
# Copyright (C) 1999-2013, International Business Machines
# Corporation and others. All Rights Reserved.
#******************************************************************************
@olamedia
olamedia / axios-catch-error.js
Created September 22, 2020 22:47 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
<template>
<div>
<SortableTable :columns="columnsToShow" :items="items" itemKey="company_id">
<template slot="col-photo-cell" slot-scope="{ item: { image } }">
<td class="col-photo"><Avatar v-if="image" :src="image['60x60']" size="60px" rounded>{{ image.id }}</Avatar></td>
</template>
<template slot="col-name" slot-scope="{ item, item: { full_name, type } }">
<div class="user-row__name">{{ full_name }}</div>
<div class="user-row__role">{{ formatCompanyType(type) }}</div>
<div class="user-row__role">{{ item.warehouses }}</div>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
function blockingClick(){
console.log('blocking promise');
(new Promise((resolve, reject) => {
let i = 0;
export const {scan, isPrime, primes} = (() => {
let primes: number[] = [2];
let cursor = 2;
const chunkSize = 100;
const isPrimeAgainstKnown: (number: number) => boolean = number => primes.reduce((result, prime) => {
return result && (number % prime !== 0)
}, true)
async function nextPrime(limit: number): Promise<number|null>{
const PassThrough = require('stream').PassThrough;
class duplexLayer{
constructor(connection) {
//super(options);
var self = this;
self.connection = connection;
// Downstream
var audioSource = "",videoSource = "";
function gotSources(sourceInfos) {
for (var i = 0; i !== sourceInfos.length; ++i) {
var sourceInfo = sourceInfos[i];
//var option = document.createElement('option');
//option.value = sourceInfo.id;
if (sourceInfo.kind === 'audio') {
//option.text = sourceInfo.label || 'microphone ' + (audioSelect.length + 1);
audioSource = sourceInfo.id;
console.log("mic:"+sourceInfo.id);
// Underhanded skullduggery to access the keystore daemon.
//
// This is merely a slightly cleaned up implementation of
// http://nelenkov.blogspot.com/2012/05/storing-application-secrets-in-androids.html
// and all credit to Nikolay for digging into this.
package org.kbsriram.android.util;
import android.content.Context;
import android.content.Intent;
<project name="GraphicsCore" default="all">
<property name="jar.name" value="graphicsCore.jar" />
<property name="modloader.basedir" value="/home/olamedia/Документы/__OlaCraft/workspace/ola-modloader" />
<property name="modloader.srcdir" value="${modloader.basedir}/src" />
<property name="modloader.coremodsdir" value="${modloader.basedir}/coremods" />
<property name="jogl.classpath" value="/home/olamedia/Документы/__OlaCraft/LIBRARIES/jogl-jogamp/gluegen_614-joal_380-jogl_869-jocl_713/" />
<target name="all" description="Do the entire build" depends="run">
</target>
@olamedia
olamedia / whois.php
Created March 26, 2013 04:53
Author: Jonas John License: Public Domain Language: PHP Created: 06/08/2006
<?php
function whois_query($domain) {
// fix the domain name:
$domain = strtolower(trim($domain));
$domain = preg_replace('/^http:\/\//i', '', $domain);
$domain = preg_replace('/^www\./i', '', $domain);
$domain = explode('/', $domain);
$domain = trim($domain[0]);