Skip to content

Instantly share code, notes, and snippets.

View aliva's full-sized avatar
🤖
Hello Humans!

Ali Vakilzade aliva

🤖
Hello Humans!
View GitHub Profile
@mahdi-malv
mahdi-malv / caster.py
Last active June 20, 2020 06:17
Download a course from caster.io using scrapy and youtube-dl
"""
Prerequisites:
1. Scrapy: python3 -m pip install scrapy
2. Youtube-dl: python3 -m pip install youtube-dl
(Use conda or miniconda for windows to install scrapy. Or use WSL and install python3 on it)
It's also possible to modify this to get other courses from caster.io or even other sites.
"""
from scrapy.spiders import Spider
from scrapy.crawler import CrawlerProcess
import youtube_dl
@blha303
blha303 / compliment.b303.me.py
Last active June 25, 2021 04:41
Gets random comment from /r/gonewild, since they're pretty much all compliments. http://compliment.b303.me Warning: May contain sexual content
#!/usr/bin/env python3
import requests
from flask import *
import random
from apscheduler.schedulers.background import BackgroundScheduler
app = Flask(__name__)
scheduler = BackgroundScheduler()
url = "https://reddit.com/r/gonewild/comments.json?limit=200"
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("tweetdeck.twitter.com") {
body
{
font-family : Vazir !important;
}
.tweet-text , .compose-text
{
direction : rtl;
@lym
lym / gist:456ec863d3fc3c63cab4
Created April 17, 2015 14:04
psycopg: Error: b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'
# Just install libpq-dev
$ sudo apt-get install libpq-dev
@pgmccann
pgmccann / styles.less
Created April 17, 2014 08:59
Condensed tree view for http://atom.io. Modify stylesheet using Atom > Open Your Stylesheet.
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*
* If you are unfamiliar with LESS, you can read more about it here:
* http://www.lesscss.org
*/
@psamim
psamim / wget.sh
Last active December 25, 2015 02:59
Download Leecher
#!/usr/bin/env bash
SSH_ACCOUNT=52565751e0b8cd99d30001ba@download-psamim.rhcloud.com
DIR="files"
# SSH To Server
ssh $SSH_ACCOUNT 'bash -s'<<ENDSSH
# Get File Name
filename=\`date +%s\`
# Get File
@snormore
snormore / mongotestcase.py
Created September 29, 2012 02:59
Django, MongoDB, and MongoEngine: A custom TestCase managing test database creation and cleanup between test methods.
#coding: utf-8
from nose.plugins.skip import SkipTest
from mongoengine.python_support import PY3
from mongoengine import connect
try:
from django.test import TestCase
from django.conf import settings
except Exception as err:
@snormore
snormore / mongotestrunner.py
Created September 21, 2012 06:23
Django, MongoDB, and MongoEngine: A custom TestRunner managing mongo test database creation and cleanup.
#coding: utf-8
from django.test.simple import DjangoTestSuiteRunner
from nose.plugins.skip import SkipTest
from mongoengine.python_support import PY3
from mongoengine import connect
try:
from django.test import TestCase
from django.conf import settings
@pfreixes
pfreixes / gist:3187511
Created July 27, 2012 11:36
Supervisorctl bash autocomplete
# pfreixes, 2012-07-27
# Add to /etc/bash_completion.d/supervisorctl
_supervisor()
{
local cur prev opts base
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
#!/bin/bash
for i in $( cat following );do
proxychains curl -u milad:password http://identi.ca/api/friendships/destroy.xml -d user_id=$i
done