Skip to content

Instantly share code, notes, and snippets.

View emre's full-sized avatar
🎯
Focusing

Emre Yılmaz emre

🎯
Focusing
View GitHub Profile
@kxxoling
kxxoling / count-github-stars.py
Last active March 18, 2016 05:24
Used to count repo stars of some github user.
from __future__ import print_function
import os
import requests
github_user = os.environ.get('githubuser')
api_url = 'https://api.github.com/users/{github_user}/repos?per_page=100'.format(github_user=github_user)
if github_user is None:
github_user = raw_input('No GitHub username detected, please enter it here: ')
@emre
emre / qrkinstall.sh
Last active January 1, 2016 01:39
qrk installer script for windows azure instances (ubuntu 13.10)
#!/bin/bash
read -p "enter your wallet address: " WALLETID
sudo apt-get update
sudo apt-get install -y git automake g++ build-essential libcurl4-openssl-dev libjansson4 libjansson-dev
if [ -d $(pwd)/quarkcoin-cpuminer ]; then
rm -r $(pwd)/quarkcoin-cpuminer
fi
git clone https://github.com/uncle-bob/quarkcoin-cpuminer
cd quarkcoin-cpuminer
./autogen.sh
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
@omerucel
omerucel / .bashrc
Last active December 15, 2015 15:49
bash function for virtualenv
function mood()
{
cmd=". $HOME/.env/$1/bin/activate"
$cmd
}
_mood()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
local projects=$(ls -h $HOME/.env)
#!/usr/bin/env python
import sys
import os.path
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(PROJECT_ROOT, "../"))
from twisted.internet import reactor, task
from scrapy.crawler import Crawler
@tclancy
tclancy / django_management_profile.py
Last active January 3, 2023 22:18
Profiling Django Management Command
from cProfile import Profile
from django.core.management.base import BaseCommand
class ProfileEnabledBaseCommand(BaseCommand):
"""Enable profiling a command with --profile.
Requires child class to define _handle instead of handle.
via https://gist.github.com/dfrankow
"""
@flockonus
flockonus / app.js
Created August 9, 2012 16:05
swig on express.js 3.0
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, http = require('http')
, path = require('path')
// !
, swig = require('./config/consolidate-swig').swig
@saidimu
saidimu / gist:1024207
Created June 14, 2011 02:36
Generating URLs to crawl from outside a Scrapy spider
from scrapy import log
from scrapy.item import Item
from scrapy.http import Request
from scrapy.contrib.spiders import XMLFeedSpider
def NextURL():
"""
Generate a list of URLs to crawl. You can query a database or come up with some other means
Note that if you generate URLs to crawl from a scraped URL then you're better of using a
@emre
emre / takip.py
Created November 22, 2010 15:15
Amerika vize basvurularinda idari islem sayfasindaki listeyi kontrol edip, olasi guncellemelerde mail atar.
# -*- coding: utf-8 -*-
import urllib, re, hashlib, os, smtplib
from email.MIMEText import MIMEText
class VisaChecker(object):
"""
VisaChecker script for the applicants waiting 'administrative processing'.
"""