Skip to content

Instantly share code, notes, and snippets.

View trianglesis's full-sized avatar
🎯
Focusing

Trianglesis trianglesis

🎯
Focusing
View GitHub Profile
@trianglesis
trianglesis / GoogleAPI.py
Created February 3, 2016 19:11 — forked from SalvaJ/GoogleAPI.py
Example making HTTP request to use Google API without api-client.It works in Python3 (tested ok in 3.3.5)
#!usr/bin/python3
# -*- coding: UTF-8 -*-
"""This module is a sample of the OAuth2 authentication by Python3"""
__version__ = "0.1.0"
__author__ = "shin (shin.hateblo.jp)"
__copyright__ = "(C) 2012 shin"
__email__ = "s2pch.luck@gmail.com"
__license__ = "Apache License 2.0"
@trianglesis
trianglesis / gist:8ed6075fa7105f5fabf2b23b822cbcfa
Last active July 27, 2016 10:15 — forked from antixrist/gist:faf300eb04c1aeca9137
VK API: Parse json Args to array.
var myList = Args.post_id_array_str;
// List should end with separator, for exampe ","
// car myList = 111,222,333,444,
var listSeparator = ",";
var listItemsType = "integer";
var result = [];
var charsLength = myList.length;
var currentPosition = 0;
var previousSeparatorPosition = -1;
@trianglesis
trianglesis / vk_random.py
Last active July 27, 2016 10:18
vkid-randomizer
'''
This script is used to parse some html file
where vk ids stored and then choose
one of them randomly and export it to csv file
1. Replaced error with charset by replace character
2. Change the way how print was formatted
2.1 Added random - used range from list of ids
3. Added CSV export tool for one man
'''
@trianglesis
trianglesis / wall_getComments_parsed.vk
Created July 27, 2016 10:17
This script allows you to get all comments from post id array string.
var comment;
var comment_id;
var comment_from_id;
var comment_date;
var comment_likes;
var comments_format;
var comments_list = [];
var myList = Args.post_id_array_str;
var listSeparator = ",";
@trianglesis
trianglesis / eachPost_getComments.vk
Created July 27, 2016 10:29
Get comments from each post. For vkontakte API execute.
var myList = Args.post_id_array_str;
var listSeparator = ",";
var listItemsType = "integer";
var result = [];
var charsLength = myList.length;
var currentPosition = 0;
var previousSeparatorPosition = -1;
var item;
while (currentPosition < charsLength) {
if (myList.substr(currentPosition, 1) == listSeparator) {
@trianglesis
trianglesis / vk_b-day.py
Created July 28, 2016 08:40
Старый скриптец, который я использовал около года назад для выборки именинников и публикации поста с ними на стену сообществ Вконтакте. Выкладываю в публичный доступ, так как морально он устарел и код в нем выглядит ужасно, но подходит чисто для образовательных целей и "авось кому пригодится" мне бы он помог на первых порах изучения, может быть …
#! /usr/bin/env python3
# coding=utf-8
__author__ = 'danilcha'
# Change history
# 2015-11-16 Add note about new API method after VK_module update, and new list parsing method.
import vk
from time import gmtime, strftime
curr_date = strftime("%Y-%m-%d")
@trianglesis
trianglesis / #DelCommentRecursive.iim
Created May 11, 2018 12:01
iMacros browsed extension script for comment deletion loops on own Facebook timeline.
VERSION BUILD=1001 RECORDER=CR
URL GOTO=https://www.facebook.com/PROFILE_ID_NAME_ETC/allactivity?privacy_source=activity_log&log_filter=cluster_116
WAIT SECONDS=5
TAG POS=1 TYPE=A ATTR=aria-label:Редагувати
TAG POS=1 TYPE=SPAN ATTR=TXT:Видалити
WAIT SECONDS=5
@trianglesis
trianglesis / del 100 posts per row
Last active May 11, 2018 19:40
Delete all posts on your own page on facebook Imacros
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=https://www.facebook.com/<YOUR_ID_OF_PAGE>/allactivity?privacy_source=activity_log&log_filter=cluster_11
WAIT SECONDS=2
TAG POS=1 TYPE=A ATTR=data-tooltip-content:Дозволено<SP>в<SP>життєписі
TAG POS=2 TYPE=SPAN ATTR=TXT:Видалити
TAG POS=1 TYPE=BUTTON ATTR=TXT:Видалити<SP>допис
WAIT SECONDS=5
TAG POS=1 TYPE=A ATTR=data-tooltip-content:Дозволено<SP>в<SP>життєписі
@trianglesis
trianglesis / python_decorator_guide.md
Created July 20, 2018 11:11 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@trianglesis
trianglesis / play_sound_notification.sh
Created April 17, 2024 19:39
Simple script to play a WAV notification sound
#!/bin/bash
# Play notification sound at givel volume with given file
PATH_TO_NOTIFICATIONS="/home/USER/Music/notifications"
PATH_TO_DING="/home/USER/Music/notifications/stop.wav"
verbose=$3
sound_volume=$1
file_to_play=$2