This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.LinearGradient; | |
import android.graphics.Matrix; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff.Mode; | |
import android.graphics.PorterDuffXfermode; | |
import android.graphics.Shader.TileMode; | |
import android.util.AttributeSet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
This module will bootstrap a machine using chef. The purpose of this | |
script is actually to work with AWS Auto Scaling Groups. The user data | |
for the Launch Configuration is set to download this script and then | |
run it. This is also stores the results in a private gist and sends | |
a message to logstash with the results. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _get_date(data, position, as_class, tz_aware, uuid_subtype): | |
millis = struct.unpack("<q", data[position:position + 8])[0] | |
diff = millis % 1000 | |
seconds = (millis - diff) / 1000 | |
position += 8 | |
if tz_aware: | |
dt = EPOCH_AWARE + datetime.timedelta(seconds=seconds) | |
else: | |
dt = EPOCH_NAIVE + datetime.timedelta(seconds=seconds) | |
return dt.replace(microsecond=diff * 1000), position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if isinstance(value, datetime.datetime): | |
if value.utcoffset() is not None: | |
value = value - value.utcoffset() | |
millis = int(calendar.timegm(value.timetuple()) * 1000 + | |
value.microsecond / 1000) | |
return BSONDAT + name + struct.pack("<q", millis) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 127.0.0.0 pagead2.googlesyndication.com >> %WINDIR%\System32\Drivers\Etc\Hosts | |
echo 127.0.0.0 googleads.g.doubleclick.net >> %WINDIR%\System32\Drivers\Etc\Hosts | |
echo 127.0.0.0 google.com >> %WINDIR%\System32\Drivers\Etc\Hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 127.0.0.0 pagead2.googlesyndication.com >> %WINDIR%\System32\Drivers\Etc\Hosts | |
echo 127.0.0.0 googleads.g.doubleclick.net >> %WINDIR%\System32\Drivers\Etc\Hosts | |
echo 127.0.0.0 google.com >> %WINDIR%\System32\Drivers\Etc\Hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM docker.gamechanger.io/nodejs0.10 | |
MAINTAINER Tom Leach | |
ADD . /gc/allegro | |
WORKDIR /gc/allegro | |
RUN mv Buildfile npm-shrinkwrap.json | |
RUN npm install | |
RUN mkdir -p /var/log/allegro | |
EXPOSE 80 |