Skip to content

Instantly share code, notes, and snippets.

View ozcanyarimdunya's full-sized avatar
🌍

ÖZCAN YARIMDÜNYA ozcanyarimdunya

🌍
View GitHub Profile
import oauth2 as oauth
import urlparse
import time
#Kimlik dogrulama yapacagimiz linkedin adresi
authorize_url = 'https://api.linkedin.com/uas/oauth/authorize'
#Burada LinkedIn'den aldigimiz keylerimizi yaziyoruz. Bu key'leri yukaridaki linkden nasil aldigimizi yazdim.
consumer = oauth.Consumer(key="**********", secret="***********")
authToken="*********-*****-****-*******-*************"
@kaotika
kaotika / qprogressbar_thread.py
Last active November 12, 2022 10:10
Simple PyQt example with QThread and QProgressBar
from PyQt4 import QtCore, QtGui
import sys, time
class mythread(QtCore.QThread):
total = QtCore.pyqtSignal(object)
update = QtCore.pyqtSignal()
def __init__(self, parent, n):
super(mythread, self).__init__(parent)
@saleph
saleph / centering.py
Last active August 8, 2022 05:20
[qt5] center a window on screen
__author__ = 'tom'
import sys
from PyQt5.QtWidgets import QWidget, QDesktopWidget, QApplication
class Example(QWidget):
def __init__(self):
super().__init__()
self.init_ui()
@jonsuh
jonsuh / .bash_profile
Last active February 16, 2024 17:17
Bash echo in color
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
# creating and testing permissions and test groups in django tests.
from django.contrib.auth.models import User, Permission, Group
from django.test import TestCase
from django.test import Client
class ExampleGroupPermissionsTests(TestCase):
def setUp(self):
#create permissions group
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@pylover
pylover / inspections.txt
Last active April 22, 2024 07:47 — forked from ar45/inspections.txt
PyCharm inspections
# Extracted using: $ unzip -p lib/pycharm.jar com/jetbrains/python/PyBundle.properties | grep -B1 INSP.NAME | grep '^#' | sed 's|Inspection||g' | sed -e 's|#\s\{,1\}|# noinspection |'
# noinspection PyPep8
# noinspection PyPep8Naming
# noinspection PyTypeChecker
# noinspection PyAbstractClass
# noinspection PyArgumentEqualDefault
# noinspection PyArgumentList
# noinspection PyAssignmentToLoopOrWithParameter
# noinspection PyAttributeOutsideInit
@ferdiunal
ferdiunal / array2json.php
Last active June 27, 2023 00:54
Ülkelerin İl, İlçeleri. Şimdilik Türkiye'yi ekleyebildim.
#!/usr/bin/env php
<?php
/**
* @author Ferdi ÜNAL
* @email ferdi@unal.pw
*/
$location = require "location.php";
$json = fopen('location.json', 'w');
@genomics-geek
genomics-geek / README.md
Last active January 10, 2024 15:27
Setting up a Dockerized web application with Django REST APIs, ReactJS with Redux pattern, and Webpack Hot Reloading! Mouthful.

Guide on how to create and set up a Dockerized web app using Django REST APIs and ReactJS

Hopefully this will answer "How do I setup or start a Django project using REST Framework and ReactJS?"

This is a guide to show you step by step how this can be setup. If you just want to get started, use the cookiecuter I set up cookiecutter-django-reactjs. It basically is a fork of pydanny's cookiecutter, just added the front-end stuff :).

I created this because it was SUCH a pain in the ass setting up a project using all the latest technologies. After some research, I figured it out and have it working. The repo that implements this is located here. Feel free to use it as a boilerplate ;)

Main features:

  • Django REST APIs
@stephenharris
stephenharris / install-firefox-linux.md
Last active April 2, 2023 09:44
Installing a particular version of firefox on Linux.

Installing a particular version of FireFox on Linux

  1. Does an existing version of firefox exist?

    firefox --version
    

    If not, skip to (3).