Skip to content

Instantly share code, notes, and snippets.

View adopilot's full-sized avatar
🎯
Focusing

Admir adopilot

🎯
Focusing
  • Robot General Trading Co doo
  • Sarajevo Bosnia and Hercegovina
  • X @pilotado
View GitHub Profile
@codehippie1
codehippie1 / How to add pdf.js and viewer.html to angular 2 application.(With Optional aspnet core|webapi|mvc backend report generation using MS Local RDLC report viewer).md
Last active July 1, 2022 09:31
How to add pdf.js and viewer.html to angular 2 application.(With Optional aspnet core/webapi/mvc backend report generation using MS Local RDLC report viewer)

How to add pdf.js and viewer.html to angular 2 application.(With Optional aspnet core/webapi/mvc backend report generation using MS Local RDLC report viewer)

  1. copy the 'web' and 'build' folders from https://github.com/mozilla/pdfjs-dist under your application's assets folder.
  2. Get/Create your `Blob() object
this.http.get(url, { responseType: ResponseContentType.Blob }).map(
(res) => {
  return new Blob([res.blob()], { type: fileType });
});
  1. Create url using blob and supply to viewer.html
@divega
divega / MyContext.cs
Last active May 18, 2020 04:35
Simple builder class for creating TVPs that work in .NET Core 1.0
using Microsoft.EntityFrameworkCore;
namespace TvpSampleApp
{
public class MyContext : DbContext
{
public DbSet<Person> People { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
@667bdrm
667bdrm / dvr-alarm-server.pl
Last active May 16, 2021 17:43
Chinese DVR Alarm Server
#!/usr/bin/perl
#
# Simple log/alarm server receiving and printing to console remote dvr/camera events.
# future releases at https://gitlab.com/667bdrm/sofiactl
# Tested with:
#
# HJCCTV HJ-H4808BW
# http://www.aliexpress.com/item/Hybird-NVR-8chs-H-264DVR-8chs-onvif-2-3-Economical-DVR-8ch-Video-4-AUDIO-AND/1918734952.html
#
@paully21
paully21 / aspnetmvc_discourse_sso.cs
Created February 26, 2014 16:25
ASP.NET MVC Discourse SSO Example
public ActionResult DiscourseLogin()
{
if (string.IsNullOrEmpty(Request.QueryString["sso"]) || string.IsNullOrEmpty(Request.QueryString["sig"]))
return Content("Invalid");
string ssoSecret = "YOUR SSO SECRET"; //must match sso_secret in discourse settings
string sso = Request.QueryString["sso"];
string sig = Request.QueryString["sig"];
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MoveIndexToFileGroup]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[MoveIndexToFileGroup]
GO
CREATE PROC [dbo].[MoveIndexToFileGroup] (
@DBName sysname,
@SchemaName sysname = 'dbo',
@ObjectNameList Varchar(Max),
@IndexName sysname = null,
@FileGroupName varchar(100)
@dalenewman
dalenewman / gist:6377911
Last active August 16, 2023 15:08
A T-SQL stored procedure for moving an index from one file group to another. The original script was found at http://blogs.msdn.com/b/ramoji/archive/2008/09/26/how-to-move-existing-indexes-from-one-filegroup-to-another.aspx and updated according to responses found on the same page.
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MoveIndexToFileGroup]') AND type in (N'P', N'PC'))
BEGIN
DROP PROCEDURE [dbo].[MoveIndexToFileGroup]
END
GO
CREATE PROC [dbo].[MoveIndexToFileGroup] (
@DBName sysname,
@SchemaName sysname = 'dbo',
@ObjectNameList Varchar(Max),
@superdaigo
superdaigo / zabbix-alert-smtp.sh
Created September 20, 2012 04:58
Zabbix SMTP Alert script for gmail
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Zabbix SMTP Alert script for gmail.
"""
import sys
import smtplib
from email.MIMEText import MIMEText
from email.Header import Header