Skip to content

Instantly share code, notes, and snippets.

@staeff
staeff / openldap_passwd.py
Created Feb 19, 2019 — forked from rca/openldap_passwd.py
Python hashing and test functions for user passwords stored in OpenLDAP.
View openldap_passwd.py
#!/usr/bin/env python
"""
http://www.openldap.org/faq/data/cache/347.html
As seen working on Ubuntu 12.04 with OpenLDAP 2.4.28-1.1ubuntu4
Author: Roberto Aguilar <roberto@baremetal.io>
"""
import hashlib
import os
View Api-notes.md
@staeff
staeff / bundle.css
Created Oct 27, 2017
Angular Cheat Sheet
View bundle.css
.mat-elevation-z0{box-shadow:0 0 0 0 rgba(0,0,0,.2),0 0 0 0 rgba(0,0,0,.14),0 0 0 0 rgba(0,0,0,.12)}.mat-elevation-z1{box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12)}.mat-elevation-z2{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mat-elevation-z3{box-shadow:0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12)}.mat-elevation-z4{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.mat-elevation-z5{box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 5px 8px 0 rgba(0,0,0,.14),0 1px 14px 0 rgba(0,0,0,.12)}.mat-elevation-z6{box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12)}.mat-elevation-z7{box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12)}.mat-elevation-z8{box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba
@staeff
staeff / style.scss
Created Jan 30, 2017
Write BEM with SASS. BEM modules can be nested using the & to prefix our elements or modifiers
View style.scss
/* Sass 3.3+ w/BEM: */
.object {
color: red;
&__descendant {
color: black;
}
}
/* Generates:
View index.html
<!DOCTYPE html>
<html>
<head>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<style>
[data-icon]:before {
font-family: 'FontAwesome';
content: attr(data-icon);
@staeff
staeff / README.md
Last active Oct 30, 2021
Understanding module exports in node.js
View README.md
@staeff
staeff / gist:29254ee242b860740487
Last active Mar 14, 2016 — forked from blairg23/gist:dc421453b035321a5e27
Oauth Example Authentication with Flickr using requests_oauthlib in Python
View gist:29254ee242b860740487
import requests_oauthlib
api_key = <api_key_here>
api_secret = <api_secret_here>
# OAuth URLs
request_token_url = 'https://www.flickr.com/services/oauth/request_token'
access_token_url = 'https://www.flickr.com/services/oauth/access_token'
authorization_url = 'https://www.flickr.com/services/oauth/authorize'
@staeff
staeff / index.html
Last active Nov 2, 2017
Wikimedia API calls
View index.html
<html>
<head>
</head>
<body>
<h2>Jpgs</h2>
<a href='https://de.wikipedia.org/wiki/Wikipedia:Hauptseite#/media/File:Fl%C3%BCchtlinge_in_Braunau_am_Inn_01.JPG' class='bootstrap_oembed'>
https://de.wikipedia.org/wiki/Wikipedia:Hauptseite#/media/File:Fl%C3%BCchtlinge_in_Braunau_am_Inn_01.JPG</a>
@staeff
staeff / skyscanner.py
Created Mar 5, 2016
Skyscanner browse quotes
View skyscanner.py
import json
import requests
from pprint import pprint
API_KEY = 'hier dein api key'
def get_currencies():
""" Get the list of valid currencies supported by Skyscanner """
url = 'http://partners.api.skyscanner.net/apiservices/reference/v1.0/currencies?apiKey={0}'.format(API_KEY)
return requests.get(url)
@staeff
staeff / README.md
Last active Feb 6, 2017
Get and process (oembed) data from flickr and wikimedia
View README.md
  • Flickr
  • Wikimedia