Try Chardet(https://pypi.python.org/pypi/chardet)
(Need to change font)
chcp 65001
Want to get back?
wait_single_host() { | |
local host=$1 | |
shift | |
local port=$1 | |
shift | |
echo "==> Check host ${host}:${port}" | |
while ! nc ${host} ${port} > /dev/null 2>&1 < /dev/null; do echo " --> Waiting for ${host}:${port}" && sleep 1; done; | |
} |
#!/usr/bin/ruby | |
class IPGenerator | |
public | |
def initialize(session_count, session_length) | |
@session_count = session_count | |
@session_length = session_length | |
@sessions = {} | |
end |
const shell = require('./modules/shell'); | |
var shellRegex = new RegExp('^/shell(' + BOTNAME + ')?$', 'i'); | |
bot.onText(shellRegex, (msg, match) => { | |
var messageId = msg.message_id; | |
var chatId = msg.chat.id; | |
var fromId = msg.from.id; | |
var opts = { | |
reply_markup: JSON.stringify({force_reply: true, selective: true}), | |
reply_to_message_id: messageId |
Try Chardet(https://pypi.python.org/pypi/chardet)
(Need to change font)
chcp 65001
Want to get back?
These are the Terminal commands I recently used (June 2016) to install Git 2.13.0 from source on RHEL 7.x. I ran this in a VirtualBox VM after a fresh install from the ISO.
You mileage will vary as the yum packages are updated over time. The yum install
line below should include all the dependencies, at least it did for me. Depending upon how often you use yum update
you may need to run yum --enablerepo=base clean metadata
as su
before you run the following commands.
cd ~/Downloads
su
yum install autoconf cpio curl-devel expat-devel gcc gettext-devel make openssl-devel perl-ExtUtils-MakeMaker zlib-devel
wget -O v2.13.0.tar.gz https://github.com/git/git/archive/v2.13.0.tar.gz
"""Print SQLAlchemy queries (including bind params). | |
See also: http://docs.sqlalchemy.org/en/latest/faq/sqlexpressions.html#faq-sql-expression-string | |
""" | |
def show_query(query): | |
qc = query.statement.compile( | |
dialect=query.session.bind.dialect, |
""" Author contact: sepero 111 @ gmail . com """ | |
from django import http | |
from django.utils.http import urlquote | |
from django.core import urlresolvers | |
class RemoveSlashMiddleware(object): | |
""" | |
This middleware works like django's built in APPEND_SLASH, but in reverse. Eg |
#!/usr/bin/env xcrun swift -O | |
/* | |
gen.swift is a direct port of cfdrake's helloevolve.py from Python 2.7 to Swift 3 | |
-------------------- https://gist.github.com/cfdrake/973505 --------------------- | |
gen.swift implements a genetic algorithm that starts with a base | |
population of randomly generated strings, iterates over a certain number of | |
generations while implementing 'natural selection', and prints out the most fit | |
string. | |
The parameters of the simulation can be changed by modifying one of the many |
import pip | |
from subprocess import call | |
for dist in pip.get_installed_distributions(): | |
call("pip install --upgrade " + dist.project_name, shell=True) |
-- This script can be used in conjunction with Better Touch Tool to display the currently playing track on the MacBook Pro TouchBar | |
-- More info here: https://lucatnt.com/2017/02/display-the-currently-playing-track-in-itunesspotify-on-the-touch-bar | |
if application "iTunes" is running then | |
tell application "iTunes" | |
if player state is playing then | |
return (get artist of current track) & " - " & (get name of current track) | |
else | |
return "" | |
end if |