Skip to content

Instantly share code, notes, and snippets.

View sojournercntl's full-sized avatar
🌌
at work

Marcus sojournercntl

🌌
at work
View GitHub Profile
@sojournercntl
sojournercntl / email.js
Created June 2, 2019 16:47
Node.JS Mail
var Imap = require("imap");
var MailParser = require("mailparser").MailParser;
var Promise = require("bluebird");
Promise.longStackTraces();
var imapConfig = {
user: 'USERNAME',
password: 'PASSWORD',
host: 'HOST',
port: 993,
@sojournercntl
sojournercntl / csrf.js
Created July 9, 2018 18:26
CSRF - Django Rest Framework Util
var jQuery = window.$;
// using jQuery
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
@sojournercntl
sojournercntl / NotificationEmail.java
Created April 23, 2018 21:00
A java class that provides a simple notificcation email function. To inform subscribed participants about events or procedures beeing finished etc.
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class NotificationEmail{
private String from = "email@host.com";
private String to = "emailto@host.com";
@sojournercntl
sojournercntl / style.css
Created March 15, 2018 22:20
Flat Wallet Gist
.wallet {
position: absolute;
display: block;
width: 450px;
height: 340px;
background: #444;
border-radius: 15px;
box-shadow: 0px 0px 120px rgba(40,40,40,0.8);
top: 50%;
@sojournercntl
sojournercntl / DiscordRpc.cs
Created March 13, 2018 23:28 — forked from dtzxporter/DiscordRpc.cs
Discord Rpc .NET
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
//
// Discord Rpc Wrapper for .NET Framework (DTZxPorter) 12/26/2017
// Wrapper created using the open-source discord-rpc extension at:
@sojournercntl
sojournercntl / gist:36f7ac765a5d4dbe0b2d90e6dc223e8e
Created October 29, 2017 22:42 — forked from hansmaad/gist:9187633
WPF Flat Combo Box Style
<!-- Flat ComboBox -->
<SolidColorBrush x:Key="ComboBoxNormalBorderBrush" Color="#e3e9ef" />
<SolidColorBrush x:Key="ComboBoxNormalBackgroundBrush" Color="#fff" />
<SolidColorBrush x:Key="ComboBoxDisabledForegroundBrush" Color="#888" />
<SolidColorBrush x:Key="ComboBoxDisabledBackgroundBrush" Color="#eee" />
<SolidColorBrush x:Key="ComboBoxDisabledBorderBrush" Color="#888" />
<ControlTemplate TargetType="ToggleButton" x:Key="ComboBoxToggleButtonTemplate">
<Grid>
<Grid.ColumnDefinitions>