Skip to content

Instantly share code, notes, and snippets.

View MasterGroosha's full-sized avatar

Aleksandr MasterGroosha

View GitHub Profile
@eternnoir
eternnoir / webhookexample.py
Last active August 30, 2015 13:28
webhook example.
def webhook():
json_str = request.josn
json_obj = json.loads(json_str)
new_message = types.Message.de_json(json_obj['message'])
telebot.process_new_messages([new_messages]) # process_new_messages need message array
@douglasmiranda
douglasmiranda / gist:ad5da92c580ae7a3ecc9
Created August 23, 2015 21:23
virtualbox - vboxmanage convert vmdk to vdi
vboxmanage clonehd disk1.vmdk disk1.vdi --format VDI --variant Standard
@cedricpim
cedricpim / gist:5986a839ff40e6bded86
Last active March 15, 2017 21:33 — forked from zbal/gist:7800423
VirtualBox Guest Additions
# Based on https://gist.github.com/fernandoaleman/5083680
# Start the old vagrant
$ vagrant init ubuntu_saucy
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
@grugq
grugq / gist:03167bed45e774551155
Last active April 15, 2025 11:22
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@Jogan
Jogan / FloatingActionButton.java
Last active February 6, 2025 22:38
Implementation of Android L's floating action button pattern. API 14+
package your_package;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@pfmoore
pfmoore / factorio-recipe-parser.lua
Last active July 16, 2024 16:50
Parse the Factorio recipe files to create a CSV of recipes
data = {}
data["extend"] = function (data, t)
for n, recipe in ipairs(t) do
for i, component in ipairs(recipe["ingredients"]) do
cname = component[1] or component["name"]
camt = component[2] or component["amount"]
print('"' .. recipe["name"] .. '","' .. cname .. '",' .. camt)
end
end
end
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
The Snowball stemmer.
Pavel Perestoronin © 2013
"""
import re
import unittest
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@ssokolow
ssokolow / pagination_example.sql
Created December 23, 2009 13:02
Reasonably efficient pagination without OFFSET (SQLite version)
-- Reasonably efficient pagination without OFFSET
-- SQLite version (Adapted from MS SQL syntax)
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6
SELECT foo, bar, baz, quux FROM table
WHERE oid NOT IN ( SELECT oid FROM table
ORDER BY title ASC LIMIT 50 )
ORDER BY title ASC LIMIT 10