Skip to content

Instantly share code, notes, and snippets.

@myano
myano / recommended_addons.md
Last active Aug 10, 2017
Recommended Browser Addons/Extensions
View recommended_addons.md
View ilove.py
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 '
View re_test.py
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 Nov 8, 2016 — forked from sukharevd/wildfly-install.sh
Script to install JBoss Wildfly 10.x as service in Linux
View wildfly-install.sh
#!/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
View librefm.md
  • $ 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
View main.js
'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
Format a really long number with commas
View pretty_number.py
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 Mar 29, 2016
Non-submitted solution for COhPy's 201602 challenge, (https://github.com/cohpy/challenge-201602-leapday).
View 201602.py
#!/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 Jul 4, 2016
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 Jul 4, 2016
List of sources for results of the 2016 Primary on Super Tuesday (2016-03-01)