This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install request | |
// npm install cheerio | |
const request = require("request"); | |
const cheerio = require("cheerio") | |
function getMembersCount(channel) { | |
return new Promise((resolve, reject) => { | |
request(`https://t.me/${channel}/?pagehidden=false`, (error, resp, body) => { | |
const data = cheerio.load(body, {normalizeWhitespace:true}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by nirlevy on 02/07/2017. | |
* MIT Licence | |
*/ | |
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { Animated, Easing } from 'react-native'; | |
export class RotatingView extends Component { | |
state = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PYANDROID | |
# VERSION 1.1 ALPHA | |
# USES (v1.0): | |
# android_version(e*) | |
# sdk_version(e) | |
# android_name(e) | |
# processor_machine() | |
# ram_total(type_) | |
# directory_size(directory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import pprint | |
import subprocess | |
def get_processes(): | |
""" | |
Parse the output of `ps aux` into a list of dictionaries representing the parsed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extracted using: $ unzip -p lib/pycharm.jar com/jetbrains/python/PyBundle.properties | grep -B1 INSP.NAME | grep '^#' | sed 's|Inspection||g' | sed -e 's|#\s\{,1\}|# noinspection |' | |
# noinspection PyPep8 | |
# noinspection PyPep8Naming | |
# noinspection PyTypeChecker | |
# noinspection PyAbstractClass | |
# noinspection PyArgumentEqualDefault | |
# noinspection PyArgumentList | |
# noinspection PyAssignmentToLoopOrWithParameter | |
# noinspection PyAttributeOutsideInit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stream Video with OpenCV from an Android running IP Webcam (https://play.google.com/store/apps/details?id=com.pas.webcam) | |
# Code Adopted from http://stackoverflow.com/questions/21702477/how-to-parse-mjpeg-http-stream-from-ip-camera | |
import cv2 | |
import urllib2 | |
import numpy as np | |
import sys | |
host = "192.168.0.220:8080" | |
if len(sys.argv)>1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# As the Kivy docs ( http://kivy.org/docs/guide/other-frameworks.html ) state: | |
# install_twisted_rector must be called before importing and using the reactor. | |
from kivy.support import install_twisted_reactor | |
install_twisted_reactor() | |
from autobahn.twisted.websocket import WebSocketClientProtocol, \ | |
WebSocketClientFactory | |
class MyKivyClientProtocol(WebSocketClientProtocol): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_count(q): | |
count_q = q.statement.with_only_columns([func.count()]).order_by(None) | |
count = q.session.execute(count_q).scalar() | |
return count | |
q = session.query(TestModel).filter(...).order_by(...) | |
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ... | |
print q.count() |
NewerOlder