Skip to content

Instantly share code, notes, and snippets.

View ennorehling's full-sized avatar

Enno Rehling ennorehling

View GitHub Profile
@h4de5
h4de5 / wsl-ssh-pageant.md
Last active October 2, 2023 13:33
Use putty's SSH key agent (pageant) from windows in WSL bash - no more "ssh-add" needed

prepare on windows cmd

see: https://github.com/benpye/wsl-ssh-pageant

mkdir workspace
cd workspace
git clone git@github.com:benpye/wsl-ssh-pageant.git
cd wsl-ssh-pageant
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /out:wsl-ssh-pageant.exe Program.cs
from util import hook
import requests, re
@hook.command
def printerfact(inp, say=None):
r = requests.get('https://catfacts-api.appspot.com/api/facts?number=1')
fact = r.json()['facts'][0]
regex = re.compile(re.escape("cat"), re.IGNORECASE)
return regex.sub("printer", fact)
@drmalex07
drmalex07 / drupal7-multistep-form-example.php
Created April 20, 2014 06:29
An example with multistep forms in drupal7. #drupal #drupal7 #multistep-form
<?php
function helloworld_multistep_example_form($form, &$form_state)
{
// We add 2 keys to form_state ("step" and "state") to keep track
// of state in a multistep form.
$step = isset($form_state['step'])? ($form_state['step']) : (1);
$form['heading'] = array(
'#type' => 'markup',
@aras-p
aras-p / preprocessor_fun.h
Last active May 8, 2024 06:45
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,