Skip to content

Instantly share code, notes, and snippets.

View mormegil-cz's full-sized avatar

Petr Kadlec mormegil-cz

View GitHub Profile
@philchristensen
philchristensen / svn-color.py
Created August 10, 2010 20:20
Color-Coded `svn status`

First there was: http://snipplr.com/view/15246/color-coded-svn-status

Then there was: http://snipplr.com/view/16540/color-coded-svn-status-v2

A few days ago, I found a handy script online that colorized the output of SVN status. It worked pretty well, but needed a little polish and a couple of tweaks to make it use more common Python idioms. As I continued to use it and fix bugs and inefficiencies, I ended up replacing nearly every line in the original, but it was still a great starting point.

Additional changes include ANSI word-wrapping, a configurable tab expansion feature (for better code alignment), the 'colorizedSubcommands' sequence so that only applicable commands get colorized, use of proper subprocess module calls so that piping through less will work (for example, try svn-color diff | less -r to see colorized diff output).

To use, stick it somewhere, make executable (`chmod 7

public static Func<TA, TResult> DeepSpace9<TA, TResult>(Func<Func<TA, TResult>, Func<TA, TResult>> a)
{
return
t => a(DeepSpace9(a))(t);
}
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.Linq;
using System.Security.AccessControl;
using System.Text;
using System.Threading.Tasks;
namespace Mormegill_test
@FunTimeCoding
FunTimeCoding / phd
Created June 21, 2014 17:46
phabricator daemons init script
#! /bin/sh
### BEGIN INIT INFO
# Provides: phd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: phabricator
# Description: manages phd
### END INIT INFO
@parmentf
parmentf / GitCommitEmoji.md
Last active July 19, 2024 04:00
Git Commit message Emoji
@abatkin
abatkin / CITRIX.md
Created May 26, 2017 03:53
Make Citrix Receiver and Storefront usable on Linux

In order to make Citrix Receiver on Linux function nicely, I have modified the following settings in ~/.ICAClient/All_Regions.ini:

  • In [Virtual Channels\Seamless Windows]:
    • Set TWIMode=FALSE
    • This forces the window into true Fullscreen mode (as opposed to Seamless mode where the window happens to be fullscreen - there is a big difference!)
  • In [Virtual Channels\Mouse]:
    • Set MouseSendsControlV=False
    • This makes the middle mouse button function as a middle mouse button (as opposed to sending Ctrl+V, which I can't imagine anyone on Earth would actually want)
  • In [Virtual Channels\Keyboard]:
  • Set TransparentKeyPassthrough=FullScreenOnly
@kontez
kontez / freeotp_backup.md
Created January 4, 2018 14:27 — forked from jleclanche/freeotp_backup.md
A guide to back up and recover 2FA tokens from FreeOTP (Android)

Backing up and recovering 2FA tokens from FreeOTP

Backing up FreeOTP

Using adb, create a backup of the app using the following command:

adb backup -f freeotp-backup.ab -apk org.fedorahosted.freeotp
@insin
insin / updatePasswords.js
Last active June 21, 2024 18:43
Mass update Firefox passwords (run in Tools → Web Developer → Browser Console) - https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox#Enabling_the_Browser_Toolbox
function updatePasswords() {
let oldPassword = prompt('Old password:')
if (!oldPassword) return
let loginManager = Components.classes['@mozilla.org/login-manager;1']
.getService(Components.interfaces.nsILoginManager)
let matchingLogins = loginManager.getAllLogins().filter(l => l.password === oldPassword)
let matchCount = matchingLogins.length
if (matchCount === 0) return alert('No matching logins found')

The Freenode resignation FAQ, or: "what the fuck is going on?"

IMPORTANT NOTE:

It's come to my attention that some people have been spamming issue trackers with a link to this gist. While it's a good idea to inform people of the situation in principle, please do not do this. By all means spread the word in the communities that you are a part of, after verifying that they are not aware yet, but unsolicited spam is not helpful. It will just frustrate people.

Update 3 (May 24, 2021)

A number of things have happened since the last update.

import os
import pickle
import warnings
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Dropout