Sometimes, there are some untagged images left behind after failed builds. In order to get rid of those, this script can be used.
#!/bin/bash
docker rm $(docker ps -aq)
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
from io import BytesIO | |
import requests | |
from django.core.files.images import ImageFile | |
from wagtail.wagtailimages.models import Image | |
# event is a model object, substitute your model | |
# filename and title are up to you | |
# in my model, event.event_image is a ForeignKey to wagtailimages.Image | |
response = requests.get(url) |
// 3. Use the response | |
// ================================ | |
responsePromise | |
// 3.1 Convert the response into JSON-JS object. | |
.then(function(response) { | |
return response.json(); | |
}) | |
// 3.2 Do something with the JSON data | |
.then(function(jsonData) { | |
console.log(jsonData); |
#! /usr/bin/env python | |
class Point(object): | |
def __init__(self, _x, _y, _order = None): self.x, self.y, self.order = _x, _y, _order | |
def calc(self, top, bottom, other_x): | |
l = (top * inverse_mod(bottom)) % p | |
x3 = (l * l - self.x - other_x) % p | |
return Point(x3, (l * (self.x - x3) - self.y) % p) |
#!/usr/bin/python2 | |
import serial | |
import re, sys, signal, os, time, datetime | |
import RPi.GPIO as GPIO | |
BITRATE = 9600 | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(7, GPIO.OUT) | |
GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP) |
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real
(function($){ | |
ListFilterCollapsePrototype = { | |
bindToggle: function(){ | |
var that = this; | |
this.$filterTitle.click(function(){ | |
that.$filterContent.slideToggle(); | |
that.$list.toggleClass('filtered'); | |
}); | |
}, | |
init: function(filterEl) { |
""" | |
Copyright (c) 2009, Sean Creeley | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, | |
are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
* Redistributions in binary form must reproduce the above copyright notice, |