Skip to content

Instantly share code, notes, and snippets.

@myano
myano / recommended_addons.md
Last active August 10, 2017 16:09
Recommended Browser Addons/Extensions
def lovelike(jenni, input):
if input.sender in ['#reddit-baseball']:
return
if random.random() <= 0.25:
verb = input.group(1)
obj = input.group(2)
if len(obj) >= 100:
obj = obj[:100] + ' [...]'
out = 'I '
import re
txt = 'some smoe msoe soem http://www.google.com/meep/peem/peme soMe sMoe Msoe soeM https://www.google.com/meep/peem/pmep/ soem msoe smoe some'
def my_replace(match):
if not str(match.group()).startswith('http'):
return re.sub('(?i)m', '_', match.group())
else:
return match.group()
@myano
myano / wildfly-install.sh
Created November 8, 2016 18:22 — forked from sukharevd/wildfly-install.sh
Script to install JBoss Wildfly 10.x as service in Linux
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 10.x
#more :http://sukharevd.net/wildfly-8-installation.html
#author :Dmitriy Sukharev
#date :2016-06-18T02:45-0700
#usage :/bin/bash wildfly-install.sh
#tested-version1 :10.0.0.CR3
#tested-distros1 :Ubuntu 15.10; Debian 7,8; CentOS 7; Fedora 22
#tested-version2 :10.0.0.Final
@myano
myano / librefm.md
Last active November 8, 2016 16:48
  • $ git clone https://github.com/inverse/web-scrobbler.git
  • $ git checkout multi-scrobble
  • Open up Chrome/Chromium
  • Click the 3 dots/hamburger (menu in the top right corner)
  • Click More Tools
  • Click Extensions
  • Click Developer mode
  • Click Load unpacked extension...
  • Navigate to and select the folder for web-scrobbler that you just downloaded
  • The extension will load/install
@myano
myano / main.js
Created November 7, 2016 17:29
web-scrobbler\core\background\main.js from https://github.com/inverse/web-scrobbler/tree/multi-scrobble
'use strict';
/**
* Background script entry point
*
* - sets up injecting mechanism for supported sites
* - creates controllers for each recognized tab
* - sets up all chrome.* listeners, which are forwarded controllers if needed
* - checks auth status on run (browser start or extension enabling) and prompts for login if needed
*/
@myano
myano / pretty_number.py
Created May 5, 2016 00:23
Format a really long number with commas
def formatnumber(n):
"""Format a number with beautiful commas."""
parts = list(str(n))
for i in range((len(parts) - 3), 0, -3):
parts.insert(i, ',')
return ''.join(parts)
@myano
myano / 201602.py
Created March 29, 2016 23:01
Non-submitted solution for COhPy's 201602 challenge, (https://github.com/cohpy/challenge-201602-leapday).
#!/usr/bin/env python3
## This works in Python 2 and Python 3
import datetime as dt
for x in range(2020, 1000000, 4):
t = dt.datetime(x, 2, 29)
if t.weekday() == 0:
print("Found it! {0}".format(x))
@myano
myano / odds.md
Last active July 4, 2016 08:28
List of sites with statistics/prediction based on *future trading* for the upcoming 2016 primaries for both Democrats and Republicans
@myano
myano / results.md
Last active July 4, 2016 08:28
List of sources for results of the 2016 Primary on Super Tuesday (2016-03-01)