In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
| --allow-unverified PIL | |
| --allow-unverified bar | |
| PIL==1.0 | |
| foo=2.0 # Implicitly depends on bar, which requires an unverified |
| import zmq | |
| DEFAULT_PAGE = '\r\n'.join([ | |
| "HTTP/1.0 200 OK", | |
| "Content-Type: text/plain", | |
| "", | |
| "Hello, World!", | |
| ]) |
| %: | |
| convert postit-blank.png -draw "text 25, 60 $(filter-out $@,$(MAKECMDGOALS))" -pointsize 40 | lp |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| ''' | |
| An authentication module for pyzmq modelled on zauth from czmq. | |
| The functions to read and generate certificates should be interoperable | |
| with czmq's zcert's - though are not as fully featured. | |
| ''' | |
| import datetime | |
| import glob | |
| import json |
| --- | |
| # run this with ansible-playbook -i ansible_hosts bootstrap.yml -k -c paramiko | |
| - hosts: jails_host | |
| gather_facts: false | |
| remote_user: root | |
| tasks: | |
| - name: install pkgng | |
| raw: "pkg_info | grep -v 'pkg-' > /dev/null ; if $? pkg_add -r pkg; rehash ; pkg2ng; echo 'WITH_PKGNG=yes' >> /etc/make.conf; echo 'packagesite: http://pkgbeta.freebsd.org/freebsd%3A9%3Ax86%3A64/latest' >> /usr/local/etc/pkg.conf; pkg update ; pkg upgrade -y" | |
| - name: install python27 | |
| raw: "pkg install -y python27" |
| ''' | |
| Bluetooth/Pyjnius example | |
| ========================= | |
| This was used to send some bytes to an arduino via bluetooth. | |
| The app must have BLUETOOTH and BLUETOOTH_ADMIN permissions (well, i didn't | |
| tested without BLUETOOTH_ADMIN, maybe it works.) | |
| Connect your device to your phone, via the bluetooth menu. After the | |
| pairing is done, you'll be able to use it in the app. |
| var pubListener = 'tcp://127.0.0.1:5555'; | |
| var subListener = 'tcp://127.0.0.1:5556'; | |
| var hwm = 1000; | |
| var verbose = 0; | |
| // The xsub listener is where pubs connect to | |
| var subSock = zmq.socket('xsub'); | |
| subSock.identity = 'subscriber' + process.pid; | |
| subSock.bindSync(subListener); |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |