Skip to content

Instantly share code, notes, and snippets.

View selfcommit's full-sized avatar
🏠
Working from home

Dan OBoyle selfcommit

🏠
Working from home
View GitHub Profile
{
"scope": "anaconda.outline.illegal",
"foreground": "#dc312e80"
},
{
"scope": "anaconda.underline.illegal",
"foreground": "#dc312e"
},
{
"scope": "anaconda.outline.warning",
{
"pep8_max_line_length": 120,
// http://damnwidget.github.io/anaconda/IDE/#look-feel
//Add the underline rules to your colorscheme
//Look under Solarized - Light and CTRL + F for anaconda:
//https://github.com/SublimeTextIssues/Core/issues/1370
@selfcommit
selfcommit / fizzbuzz.go
Created May 27, 2018 21:47
Playing around with a new language, time to write fizzbuzz
package main
import "fmt"
func main() {
for i := 1; i <= 100; i++ { //Start at 1 to avoid 0
var result = ""
if i%3 == 0{
result = "Fizz"
@selfcommit
selfcommit / m2crypto-certificates.py
Created June 28, 2016 17:25 — forked from eskil/m2crypto-certificates.py
Example of generating CA certs and CA signed certs using python m2crypto.
"""
Tools for creating a CA cert and signed server certs.
Divined from http://svn.osafoundation.org/m2crypto/trunk/tests/test_x509.py
The mk_temporary_xxx calls return a NamedTemporaryFile with certs.
Usage ;
# Create a temporary CA cert and it's private key
cacert, cakey = mk_temporary_cacert()
import os
import SOAPpy
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../lib"))
import appscale_info
import constants
# soap server located at appscale/AppDB/soap_server.py
@selfcommit
selfcommit / f.txt
Created November 2, 2015 14:59
NYTimes javascript download
(function() {if (!window.GoogleTyFxhY || typeof window.GoogleTyFxhY.push !== 'function') {window.GoogleTyFxhY = [];}window.GoogleTyFxhY.push({'_scs_': 'B_1aNDno3VvzyGoSAMefdmPADAAAAADgB4AQC','_bgu_': 'https://pagead2.googlesyndication.com/bg/CbzsU2oByTYt-pLbi77EkWqPp7C_PzuvYb1kHWsmKzc.js','_bgp_': 'sF5UVdElsv8Pfl4IytaucDEyW6Mlg5mTUhT/Xj6o6Gax6Efst8K0bH8k5Da8qfToL3yBxnqA0rlevj/M4mTzQguXjv9J+4jTbpAc1FKvPc4anREFIPp3IV/V+I9Zb58WlOhJhUwH7YJ3vCfgTCmsHWWVHSPKwVTnLrM7+AsGs8IIBctWmbSTgxm1tBT9W2fmvDySQJDGhQ8gL3afBeaSVq5SrRn+wP7kqHEnPlszzU0NYhCq7yHsC+qTLXdKyT6AL3agqCqPJkq9rI73Z4ICM8hk46tj2SOS7lu4+E4aHnP36wR5KdETrQ1cd7BVhmbvtGfa390kNjmnkfaW1eIKzXXfyHsOCNtTZn8lOq82v581mWDpKtdubfZFg4Jt7xvKDQt4KM14S4buqBEpoiKRmhRwKUS30qm8tUDpm/Rok+vQOKCJO5MrPgzU3DGjBuT5iNELLFohQlcd5YHJhGpbP32lDLTR4sMBTIcLy6N7f65CtIlDd+Oady/iHXGI5tXoYnFmfP8FDNkpFSEjqfwTivXFHL2W9wWftU/mvP/CqKk6/QhLQDMtJH/tDuyGrO5PzeRfF7PRRU4uy/35bar5BXfgTWGgEIzjnghSTFYWIZyguTRzMeZE7ciAeCWf6qMqKx0AaI/cpKKhRe82ES06vDNJuUL6uUPtmqHUCe7nYcoiIJhLjdnNjYyssKk8wxLCcf0tIvvL77JlaQH3jzsE
def _pickle_method(m):
# http://stackoverflow.com/questions/25156768/
if m.im_self is None:
return getattr, (m.im_class, m.im_func.func_name)
else:
return getattr, (m.im_self, m.im_func.func_name)
copy_reg.pickle(types.MethodType, _pickle_method)
class UsefulWorkThings(object):
def _pool_helper(self, args):
return self.get_custom_fields(*args)
@selfcommit
selfcommit / pickle_instance.py
Created May 23, 2015 14:58
Pickle an Instance
def _pickle_method(m):
if m.im_self is None:
return getattr, (m.im_class, m.im_func.func_name)
else:
return getattr, (m.im_self, m.im_func.func_name)
<div class="problem_content" role="problem">
<p>
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
</p>
<p>
Find the sum of all the multiples of 3 or 5 below 1000.
</p>
</div>