Skip to content

Instantly share code, notes, and snippets.

View fahrradflucht's full-sized avatar
🦀

mathis-west-1 fahrradflucht

🦀
  • Buchholz in der Nordheide, Germany
View GitHub Profile
class Contact < ApplicationRecord
before_save :update_status_notifications
#...
def update_status_notifications
# Clear notifications
unless status_notification_ids.empty?
status_notification_ids.each do |id|
UserMailer.dequeue_status_notification(id)

Keybase proof

I hereby claim:

  • I am fahrradflucht on github.
  • I am mathiswiehl (https://keybase.io/mathiswiehl) on keybase.
  • I have a public key ASCxsPtrbKLhn7IAVS7LhMTniXQ9D2qzZeBlYtHwg8akhgo

To claim this, I am signing this object:

@fahrradflucht
fahrradflucht / output.log
Created August 6, 2016 11:28
airmozilla docker-compose up fail
Step 12 : RUN pip install -r requirements.txt
---> Running in d61643e62635
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 262, in run
for req in parse_requirements(filename, finder=finder, options=options, session=sessi
on):
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1632, in parse_requirements
extern crate tempfile;
use self::tempfile::NamedTempFile;
use std::error::Error;
use std::ffi::OsString;
use std::io::prelude::*;
use std::process::Command;
pub fn edit_string(s: &str) -> Result<String, Box<Error>> {
let mut file = NamedTempFile::new()?;
import * as crypto from "crypto";
import fetch, { Headers } from "node-fetch";
import { promisify } from "util";
const pbkdf2 = promisify(crypto.pbkdf2);
const endpoint = "https://sync.standardnotes.org";
const email = process.env.SN_EMAIL || "";
const uip = process.env.SN_PASSWORD || "";
type ArgumentsType<T> = T extends (...args: infer A) => unknown ? A : never;
const add = (a: number, b: number): number => a + b
type Add = typeof add;
function logAdd(...args: ArgumentsType<Add>): ReturnType<Add> {
const [a, b] = args;
const result = add(a, b)
console.log(a, b, result)
@fahrradflucht
fahrradflucht / filters.php
Last active March 6, 2021 18:58
Add the "missing" `item_class`, `item_link_class` and `current_item_link_class` arguments to `wp_nav_menu`.
<?php
/**
* Adds support for passing `item_class` to `wp_nav_menu`.
*/
add_filter('nav_menu_css_class', function ($class_names, $item, $args) {
if (property_exists($args, 'item_class')) {
return array_merge($class_names, explode(' ', $args->item_class));
}
@fahrradflucht
fahrradflucht / add_github_user_keys.sh
Created March 23, 2024 14:03
Download ssh keys from GitHub and add them as authorized keys.
#!/bin/bash
# Check if a GitHub username has been provided
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <github-username>"
exit 1
fi
# Make sure we have curl installed
if ! command -v curl &> /dev/null