Skip to content

Instantly share code, notes, and snippets.

View Dviejopomata's full-sized avatar
🏠
Working from home

Dviejo Dviejopomata

🏠
Working from home
  • Alicante, Spain
View GitHub Profile
app: printv3
company: nextagilesoft
config: {}
dependencies:
postgresql:
version: 10.6
handlers:
@Dviejopomata
Dviejopomata / cmds-openssl.md
Last active September 19, 2018 15:41
Openssl common certificates

Der to pem

openssl x509 -inform der -in file.cer -out file.pem

Pem to der

openssl x509 -in file.pem -out file.cer -outform der
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.OpenSsl;
using Org.BouncyCastle.Pkcs;
using Org.BouncyCastle.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using X509Certificate = Org.BouncyCastle.X509.X509Certificate;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
IP=$1
PORT=$2
echo "Waiting for $IP to be accesible on $PORT..."
while ! nc -z $IP $PORT; do
sleep 0.5
done
notify-send "Server $IP is up"
POST /main.fbddd1fc85fb802220eb.js HTTP/1.1
Host: frontend-ng.nextagilesoft.com
CONTENT
@Dviejopomata
Dviejopomata / main.kt
Created October 4, 2018 12:01
Show android notification with alarm sound
val textTitle = "Title"
val textContent = "Content"
val alarmSound = Settings.System.DEFAULT_ALARM_ALERT_URI
val mBuilder = NotificationCompat.Builder(this, "alarm-1")
.setSmallIcon(R.drawable.navigation_empty_icon)
.setContentTitle(textTitle)
.setContentText(textContent)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
.setSound(alarmSound, AudioManager.STREAM_ALARM)
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(100)
delta = np.random.uniform(-10, 10, size=(100,))
y = -.3 * x + 3 + delta
print(delta)
plt.plot(x, y)
plt.show()
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int splitByDelim(char *str, char *delim, int *out) {
char *pt;
pt = strtok(str, delim);
public static class DbExtensions
{
public static IQueryable<T> FilterByTenant<T>(this IQueryable<T> baseEntities, string
tenantId) where T : BaseEntity
{
return baseEntities.Where(r => r.TenantId == tenantId);
}
public static IQueryable<T> FilterByTenantName<T>(this IQueryable<T> baseEntities, string
tenantId) where T : BaseEntity
{
%PDF-1.7
1 0 obj << /Type /Catalog/Pages 2 0 R >> endobj
2 0 obj << /Type /Pages /Kids [3 0 R] /Count /MediaBox [0 0 612 792] >> endobj
3 0 obj << /Type /Page /Resources 4 0 R /Contents 5 0 R >> endobj
4 0 obj << /F1 << /Type /Font /Subtype /Type1 /Basefont /Helvetica >> >> >> endobj
5 0 obj << /Size 1000 >>
stream
BT /F1 12 Tf 2 780 Td (Hello world)Tj ET
endstream
endobj