Skip to content

Instantly share code, notes, and snippets.

View tshirt2018.py
#https://imgur.com/r/Python/YeHqZ
import turtle
import random
def mandala():
window= turtle.Screen()
window.bgcolor ("black")
t = turtle.Turtle()
View iris1.py
#From https://gist.github.com/aflaxman/4043086
import csv
from pylab import *
def cface(ax, x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18):
# x1 = height of upper face
# x2 = overlap of lower face
# x3 = half of vertical size of face
# x4 = width of upper face
# x5 = width of lower face
View gist:2973378
import sys
import unittest
# 100000000 means 1 one and 0 of anything else, up to 9.
def is_self_counting(number, max):
lookup = [1,2,3,4,5,6,7,8,9,0]
print "Checking", number
for i in range(0,max):
count = number.count(lookup[i])
View rsp_file.patch
diff -u -r -P ./mainline/src/build.cc ./patched/src/build.cc
--- ./mainline/src/build.cc 2011-08-22 16:04:17.684730100 +0200
+++ ./patched/src/build.cc 2011-08-22 16:08:43.803459100 +0200
@@ -22,6 +22,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/termios.h>
+#include <errno.h>
#endif
View dry_run.patch
diff -u -r -P ./mainline/src/build.cc ./patched/src/build.cc
--- ./mainline/src/build.cc 2011-11-14 09:34:51.415514600 +0000
+++ ./patched/src/build.cc 2011-11-14 09:33:40.936364600 +0000
@@ -620,7 +620,7 @@
for (vector<Node*>::iterator i = edge->outputs_.begin();
i != edge->outputs_.end(); ++i) {
TimeStamp new_mtime = disk_interface_->Stat((*i)->path());
- if ((*i)->mtime() == new_mtime) {
+ if ((*i)->mtime() == new_mtime && !config_.dry_run) {
// The rule command did not change the output. Propagate the clean
View lexer.patch
diff -u -r -P ../mainline/src/lexer.cc ../patched/src/lexer.cc
--- ../mainline/src/lexer.cc 2012-01-04 10:38:52.271140300 +0000
+++ ../patched/src/lexer.cc 2012-01-04 10:39:04.833077500 +0000
@@ -19,6 +19,10 @@
#include "eval_env.h"
+#ifdef _WIN32
+ #define snprintf _snprintf
+#endif
View aggregated_depfiles.patch
diff -u -r -P ./mainline/src/disk_interface.cc ./mainline/src/disk_interface.cc
--- ./mainline/src/disk_interface.cc 2011-10-24 15:12:45.771598100 +0200
+++ ./patched/src/disk_interface.cc 2011-10-24 15:13:22.746552100 +0200
@@ -17,6 +17,7 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
+#include <sstream>
#include <sys/stat.h>
View configure.py
#!/usr/bin/env python
#
# Copyright 2001 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
View bootstrap.py
#!/usr/bin/env python
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software