Skip to content

Instantly share code, notes, and snippets.

View ITSecMedia's full-sized avatar
🃏
If anything is worth doing, do it with all your heart. --Buddha

Norman Eckstein ITSecMedia

🃏
If anything is worth doing, do it with all your heart. --Buddha
View GitHub Profile
@ITSecMedia
ITSecMedia / outlook_email.py
Last active December 26, 2023 16:47
Python: Create an Email with Outlook
# https://itsec.media/post/python-send-outlook-email/
import win32com.client
from win32com.client import Dispatch, constants
const=win32com.client.constants
olMailItem = 0x0
obj = win32com.client.Dispatch("Outlook.Application")
newMail = obj.CreateItem(olMailItem)
newMail.Subject = "I AM SUBJECT!!"
@ITSecMedia
ITSecMedia / promises-cljs.md
Created October 7, 2021 20:38 — forked from pesterhazy/promises-cljs.md
Promises in ClojureScript

Chaining promises

Chaining promises in ClojureScript is best done using the thread-first macro, ->. Here's an example of using the fetch API:

(-> (js/fetch "/data")
    (.then (fn [r]
             (when-not (.-ok r)
               (throw (js/Error. "Could not fetch /data")))
             (.json r)))
;;
;; Take a textfile which contains a copy of the raw html of a humblebundle user account download
;; select the download page html table with the mouse copy+paste in a textfile
;; Use this file to create a list of folders based on the download names.
;;
;; === TEXT FILE CONTENT EXAMPLE ===
;; Book of Making – Volume 1
;; Raspberry Pi Press
;; PDF
;; 49 MB md5
87 luminus: a template for creating Luminus applications
7 mala: A Leiningen template for Mala
1 maple: A leinginen template with MPL
3 mesos-framework: A template for setting up mesos-frameworks using component.
3 mies-brepl: A minimal ClojureScript project template with REPL
7 mies-node: A minimal ClojureScript Node.js project template
27 mies-om: A minimal Om project template
2 mies-weasel: A minimal ClojureScript project template with Weasel REPL, forked from mies.
40 mies: A minimal ClojureScript project template
3 mies: FIXME: write description
@ITSecMedia
ITSecMedia / all-lein-templates.txt
Created July 25, 2020 15:57 — forked from anonymous/all-lein-templates.txt
for i in {1..28} ; do lein search lein-template $i ; done | grep '^\[' | perl -pe 's,^\[,,; s,/.*?],:,' | sort | uniq -c | tee all-lein-templates.txt
1 acorn: A Leiningen template for a ClojureScript setup with Figwheel, Austin, Om.
8 amp: Leiningen template for AMP (Alfresco Module Package) projects.
1 angular-cl2: A Leiningen template for using AngularJS and ChlorineJS
1 angular: Clojure and AngularJS in perfect harmony.
6 angular: Clojure and AngularJS in perfect harmony. $ lein new angular <name>
2 angularjs-app: Leiningen template for web application with http-kit and angularjs
5 angular-simple: Clojure and AngularJS $ lein new angular-simple <name>
1 aperiodic-cljs: My cljs development starting point. Basically ripped from lein-cljsbuild.
1 apijr: clojurescript project template
1 appfgo: 'lein new' template for Funcgo application
@ITSecMedia
ITSecMedia / 00_destructuring.md
Created March 31, 2020 21:01 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@ITSecMedia
ITSecMedia / gist:f008f2ccb692277dfc12e6853e8da6fb
Last active March 25, 2020 01:26
simple vue.js 2.0 example to add dynamic values in gohugo.io static websites.
=== rest.php ===
some php that creates html output
=== put in your app.js ===
$( document ).ready(function() {
var url_api = 'http://www.domain.com/api/rest.php';
var header = new Vue({
@ITSecMedia
ITSecMedia / Lein.bat
Created December 6, 2019 12:32
Leiningen
@echo off
setLocal EnableExtensions EnableDelayedExpansion
set LEIN_VERSION=2.9.1
if "%LEIN_VERSION:~-9%" == "-SNAPSHOT" (
set SNAPSHOT=YES
) else (
set SNAPSHOT=NO
@ITSecMedia
ITSecMedia / Dapper.Extensions.fs
Created October 4, 2019 16:15 — forked from Dzoukr/Dapper.Extensions.fs
F# extensions for Dapper
module Dapper.Extensions
open System
open System.Data.SqlClient
open Dapper
let extractValue (x:obj) =
match x with
| null -> null
| _ -> match x.GetType().GetProperty("Value") with