Skip to content

Instantly share code, notes, and snippets.

View domino14's full-sized avatar
👻
i r coding

César Del Solar domino14

👻
i r coding
View GitHub Profile
numbers = [1e-15, 0.111111111111, 0.1, 12435.34314, 134341.33, 2423.11, 2423.1, 123124123.3, 0.123456789, -12.12313123, -0.111111111, -98.34, -98.3451]
[ 1e-15,
0.111111111111,
0.1,
12435.34314,
134341.33,
2423.11,
2423.1,
123124123.3,
0.123456789,
QString letters = "AAAAAAAAABBCCDDDDEEEEEEEEEEEEFFGGGHHIIIIIIIIIJKLLLLMMNNNNNNOOOOOOOOPPQRRRRRRSSSSTTTTTTUUUUVVWWXYYZ";
void genLetterCombinations(QString n, int k, QSet<QString> &combinations, QString soFar) {
if (soFar.length() == k) {
combinations.insert(soFar);
if (combinations.size() % 10000 == 0) {
qDebug() << "Combinations so far:" << combinations.size();
}
return;
}
@domino14
domino14 / gist:3711073
Created September 13, 2012 00:50
a number
{"number: 35}
@domino14
domino14 / leftronic_example.js
Created March 21, 2012 22:34
Javascript Leftronic
// Example use case for pushing a number to a widget
pushNumber("yourNumberStream", 14600);
// Example use case for pushing a location to a map widget
pushGeo("yourGeoStream", 37.8, -122.6);
// Or choose a color for your map point (red, blue, green, purple, and yellow only)
pushGeo("yourGeoStream", 37.8, -122.6, "blue");
// Example use case for pushing a title and message to a text feed widget
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
server {
listen 80;
rewrite ^(.*) https://beta.example.com$1 permanent;
}
server {
listen 443;
ssl on;
server_name www.example.com;
....
import multiprocessing
bind = "127.0.0.1:8000"
#workers = multiprocessing.cpu_count() * 2 + 1
workers = 3
pidfile = "/home/ec2-user/Webolith/gunicorn.pid"
logfile = "/home/ec2-user/Webolith/gunicorn.log"
worker_class = "sync"
timeout = 30
#daemon = True
def initializeByUserList(self, file, lex, user, secs):
# returns a table number
t1 = time.time()
lineNumber = 0
alphaSet = set()
for line in file:
word = line.strip()
if len(word) > 15 or len(word) < 2:
return 0
lineNumber += 1