Skip to content

Instantly share code, notes, and snippets.

@DanielKotik
DanielKotik / divtags.rst
Last active March 31, 2024 20:46
Colored note boxes inside Jupyter notebooks

############# Markdown parser in Jupyter notebooks ##################

<div class="alert alert-block alert-info"> <b>NOTE</b> Use blue boxes for Tips and notes. </div>

<div class="alert alert-block alert-success"> Use green boxes sparingly, and only for some specific purpose that the other boxes can't cover. For example, if you have a lot of related content to link to, maybe you decide to use green boxes for related links from each section of a notebook.

@p0kR
p0kR / hb_all_books_dl.js
Last active February 20, 2018 23:44 — forked from kfatehi/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
Forked from https://gist.github.com/kfatehi/e7642697dcda5f948854bfdebe934cd3
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
this fork downloads all formats and does so without using jquery (since that didnt work for me)
note that if you are in chrome, chrome will not download the pdfs for you by default, to fix this
type “about:plugins” in the address bar and disable chrome's pdf viewer

Notifications from Resources "Bubble Up"

Release in Chef 12.9.41 via PR #4741 core chef now has a feature which has been available in Poise for awhile, which is that notifications from within resources will now notify resources in outer run contexts. This means you can write a recipe with a service resource and send a notification to it from a resource that you write.

Notifications will bubble up from arbitrarily nested resources, so users that write resources that wrap resources which wrap your resource will still find the service resource in your default recipe.

At the same time the resources collection #find() and #lookup methods and the more commonly-used DSL method resources("service[ntpd]") has been changed to also match

@fopina
fopina / emuparadise.py
Last active January 8, 2022 17:30
Scraper script for emuparadise.me
#!/usr/bin/env python
"""
Scraper script for emuparadise.me
Usage
=====
```
fopina$ ./emuparadise.py -h
usage: emuparadise.py [-h] [--download] [--search] [--system SYSTEM] [--list]
@tknerr
tknerr / Berksfile
Last active February 6, 2017 15:19
Sample metadata.rb which reads its dependencies from Berksfile.lock. This is meant for use in "top-level cookbooks" only (~= "environment cookbook" pattern but using metadata rather than environments for locking deps)
source "https://supermarket.chef.io"
# manage direct dependencies here in Berksfile
cookbook "apache2", "1.10.4"
# dependency on self
cookbook "my-app", path: "."

brevity isn't my strongest skill but I'm seriously going to try here

Questions first

  • Is berkshelf becoming a core chef dep?
  • Is berkshelf becoming a core chef workflow dep?
  • If so, why? (what gap is it filling?)
  • If so, is it being rolled into chef proper?
  • If not, why is it not being rolled into Chef proper?
@sl4m
sl4m / gist:1470360
Created December 13, 2011 03:18 — forked from emboss/gist:1470287
Encode pre-1.9.3 RSA public keys using X.509 format
require 'openssl'
require 'base64'
rsa = OpenSSL::PKey::RSA.new(2048)
modulus = rsa.n
exponent = rsa.e
oid = OpenSSL::ASN1::ObjectId.new("rsaEncryption")
alg_id = OpenSSL::ASN1::Sequence.new([oid, OpenSSL::ASN1::Null.new(nil)])
ary = [OpenSSL::ASN1::Integer.new(modulus), OpenSSL::ASN1::Integer.new(exponent)]