// jQuery
$(document).ready(function() {
// code
})
#!/usr/bin/env python | |
"is_hard.py - tell if two files are hard links to the same thing" | |
import os, sys, stat | |
def is_hard_link(filename, other): | |
s1 = os.stat(filename) | |
s2 = os.stat(other) | |
return (s1[stat.ST_INO], s1[stat.ST_DEV]) == \ | |
(s2[stat.ST_INO], s2[stat.ST_DEV]) |
#!/usr/bin/env python | |
""" | |
Playing around with QMainWindow's nested within each other | |
as dock widgets. | |
""" | |
from random import randint | |
try: |
This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:
- Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any
*nix
based command prompt (but not the default Windows Command Prompt!) - Type
cd ~/.ssh
. This will take you to the root directory for Git (LikelyC:\Users\[YOUR-USER-NAME]\.ssh\
on Windows) - Within the
.ssh
folder, there should be these two files:id_rsa
andid_rsa.pub
. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Typels
to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be namedid_rsa
andid_rsa.pub
in order for Git, GitHub, and BitBucket to recognize them by default. - To create the SSH keys, type
ssh-keygen -t rsa -C "your_email@example.com"
. Th
from PySide import QtGui | |
#from PyQt4 import QtGui | |
import pickle | |
STYLE = 'plastique' | |
GROUPS = ['Disabled', 'Active', 'Inactive', 'Normal'] | |
ROLES = [ | |
'AlternateBase', | |
'Background', | |
'Base', |
This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).
Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.
Switch to the master branch and make sure you are up to date:
# Put this in the class | |
def get_visible_indexes(self, column=0): | |
"find all galleries in viewport" | |
# used to find first index | |
gridW = self.W # width of single items | |
gridH = self.H # height of single items | |
region = self.viewport().visibleRegion() | |
idx_found = [] | |
def idx_is_visible(idx): |
import time | |
import threading | |
class BaseThread(threading.Thread): | |
def __init__(self, callback=None, callback_args=None, *args, **kwargs): | |
target = kwargs.pop('target') | |
super(BaseThread, self).__init__(target=self.target_with_callback, *args, **kwargs) | |
self.callback = callback | |
self.method = target |
If you're here just for the section on vscode working with Python on WSL, jump here.
Windows is now a development environment that can compete with Mac and Linux. Windows Subsystems for Linux lets you have an Ubuntu (or other Linux flavor) installation that works near seemlessly inside of Windows. Hyper Terminal running WSL's Bash and Visual Studio Code feel really nice to code in. These are instructions for getting set up and smoothing out most of the remaining rough edges. I've included a section on getting vscode to work well with Python and WSL, but the general pattern should be usable for any unsupported language (as of now, I believe it's only Node.js that has WSL support in vscode).
""" | |
MIT License | |
Copyright (c) 2019 Roy Nieterau | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |