Skip to content

Instantly share code, notes, and snippets.

View xen's full-sized avatar
🔥
Light My Fire!

Mikhail Kashkin xen

🔥
Light My Fire!
View GitHub Profile
@vegard
vegard / primes.py
Created September 21, 2018 07:51
Prime factorisation diagram
# -*- coding: utf-8 -*-
#
# Author: Vegard Nossum <vegard.nossum@gmail.com>
import math
import os
import sys
import cairo
@kaspergrubbe
kaspergrubbe / geonames_postgres.rb
Last active April 4, 2024 08:12
Import files from Geonames.com into a PostgreSQL database that runs Postgis
#!/usr/bin/env ruby
require 'open3'
require 'fileutils'
def run_command(command)
puts("+: " + command)
Open3.popen2e(command) do |stdin, stdout_stderr, wait_thread|
Thread.new do
stdout_stderr.each {|l| puts l }
@dalanmiller
dalanmiller / asyncio-changefeeds.py
Created May 2, 2016 22:39
asyncio & RethinkDB changefeeds example
import rethinkdb as r
import asyncio
r.set_loop_type("asyncio")
async def get_connection():
return await r.connect("localhost", 28015)
async def changefeed_old():
@tegansnyder
tegansnyder / disable mcafee endpoint protection.md
Last active December 26, 2023 03:18
Disable McAffee Endpoint Protection OSX

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas

alternatively

sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload
@Sinkler
Sinkler / gist:bfc2099235ac96937f34
Created October 13, 2014 21:27
Flask-OAuthlib sample config: twitter, facebook, instagram, vk
# Twitter
from app.config import TWITTER_APP_KEY, TWITTER_APP_SECRET
twitter_oauth = oauth.remote_app(
'twitter',
consumer_key=TWITTER_APP_KEY,
consumer_secret=TWITTER_APP_SECRET,
base_url='https://api.twitter.com/1.1/',
request_token_url='https://api.twitter.com/oauth/request_token',
@ColtonProvias
ColtonProvias / gist:5079405
Created March 4, 2013 02:05
S3 uploader for Python 3
"""
S3 Uploader for Python 3
Colton J. Provias
Usage:
f = open('sample.png', 'rb')
contents = f.read()
response, url = upload_to_s3('AWSKEY', 'AWSSECRET', 'mybucket', 'image.png', contents, 'image/png')
"""
@amoilanen
amoilanen / webcrawler.js
Last active March 24, 2022 03:14
Simple PhantomJS-based web crawler library
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler"
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist
(function(host) {
function Crawler() {
this.visitedURLs = {};
};
@paulmillr
paulmillr / active.md
Last active April 23, 2024 17:32
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)
@jamespenguin
jamespenguin / speaker_beep.py
Created August 31, 2011 21:19
Speaker beeping fun in Python.
#!/usr/bin/env python
#
# Internal Speaker Beeping Module for Windows
#
import time
import winsound
###
# Notes Config
###
@pklaus
pklaus / print_contacts_from_address-book.py
Created June 16, 2011 18:24
How to access the Mac OS X Address Book from Python: <http://www.programmish.com/?p=26>
import objc
import AddressBook as ab
import pprint as pp
def pythonize(objc_obj):
if isinstance(objc_obj, objc.pyobjc_unicode):
return unicode(objc_obj)
elif isinstance(objc_obj, ab.NSDate):
return objc_obj.description()