Skip to content

Instantly share code, notes, and snippets.

View obstschale's full-sized avatar
🥑
Avocado for the wise.

Hans-Helge Buerger obstschale

🥑
Avocado for the wise.
View GitHub Profile
@tylerhall
tylerhall / strong-passwords.php
Created August 12, 2010 21:38
A user friendly, strong password generator PHP function.
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
// Note: the $add_dashes option will increase the length of the password by
@diogojc
diogojc / pagerank.py
Created November 3, 2011 23:11
python implementation of pagerank
import numpy as np
from scipy.sparse import csc_matrix
def pageRank(G, s = .85, maxerr = .001):
"""
Computes the pagerank for each of the n states.
Used in webpage ranking and text summarization using unweighted
or weighted transitions respectively.
@Rarst
Rarst / deprecated.md
Last active February 21, 2023 11:21
WordPress coding standards configuration for PhpStorm

Now Native

PhpStorm now bundles WordPress coding style natively, starting from version 8.

  1. Go to Project Settings > Code Style > PHP.
  2. Select Set From... (top right of window) > Predefined Style > WordPress.

No longer need to muck with this import! :)

@martinwolf
martinwolf / Preferences.sublime-settings
Last active October 8, 2015 19:18
Sublime Text 2 preferences
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"file_exclude_patterns":
[
".DS_Store",
"._*"
],
"folder_exclude_patterns":
@sindresorhus
sindresorhus / codestyle.md
Last active September 26, 2023 07:45
My preferred code style.

Code Style

  • Tab indentation
  • Single-quotes
  • Semicolon
  • Strict mode
  • No trailing whitespace
  • Multiple variable statements
  • Space after keywords and between arguments and operators
  • Return early
@grancalavera
grancalavera / unicorn.sublime-snippet
Created June 4, 2013 13:26
Unicorn Sublime Text snippet ^.^
<snippet>
<content><![CDATA[
console.log(" /");
console.log(" .7");
console.log(" \\\ , //");
console.log(" |\\\.--._/|//");
console.log(" /\\\ ) ) ).'/");
console.log(" /( \\\ // /");
console.log(" /( J`((_/ \\\");
console.log(" / ) | _\\\ /");
@mkropat
mkropat / ser-pprint.php
Last active June 3, 2016 08:43
Pretty-print PHP serialized files
#!/usr/bin/env php
<?php
$serialized = file_get_contents($argv[1]);
$obj = unserialize($serialized);
$json_obj = json_encode($obj, JSON_PRETTY_PRINT);
echo "$json_obj\n";
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@johnbillion
johnbillion / wp_mail.md
Last active January 27, 2024 14:06
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@krafit
krafit / wpseo-iconfix.php
Created December 2, 2015 12:38
Nachdem der Schmerz, den wpSEO-Menüpunkt ansehen zu müssen zu groß wurde, habe ich das Icon im Admin-Menü ersetzt.
if (function_exists(wpseo_autoload)) {
function krafit_repair_wpseo() {
?>
<style>
#adminmenu #toplevel_page_wpseo div.wp-menu-image img {
display: none;
}
#adminmenu #toplevel_page_wpseo div.wp-menu-image::before {
content: "\f511";