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
<?php | |
if(isset($_POST['img']) && !empty($_POST['img'])) { | |
$file = uniqid().".jpeg"; | |
$data = explode(",", $_POST['img']); | |
$width = $_POST['width']; | |
$height = $_POST['height']; | |
$image=imagecreatetruecolor($width, $height) or die('no hay GD!'); | |
$i = 0; | |
for($x=0; $x<=$width; $x++){ |
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
int cmp_for_sort(const void * c1, const void * c2){ | |
return strcmp(*(char **) c1, *(char **) c2); | |
} | |
int cmp_for_search(const void * c1, const void * c2){ | |
return strcmp((char *) c1, *(char **) c2); | |
} | |
int | |
getCommand() |
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 is a simple and experimental version of an interpreter for the | |
S language. It doesn't aim to be complete, just correct. | |
""" | |
from collections import defaultdict | |
import re | |
TAG = r"\s*(\[\s*(?P<tag>[a-eA-E]\d+)\s*\])?\s*" | |
NXT = r"(?P<nxt>[a-eA-E]\d+)" |
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 | |
from collections import defaultdict, deque | |
class Edge(object): | |
def __init__(self, tail, head, capacity, name=None, flow=0): | |
self.name = tail + "-" + head if not name else name | |
self.tail = tail | |
self.head = head | |
self.flow = flow | |
self.capacity = capacity |
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
#include <stdio.h> | |
#include <ctype.h> | |
#define MAX_BYTES 1 << 24 | |
int | |
read_netstring(char * buffer, size_t limit, FILE * f){ | |
size_t msgSize = 0; | |
size_t readSize = 0; | |
int c = 0; |
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
class FileDropTarget(wx.FileDropTarget): | |
def __init__(self, window): | |
wx.FileDropTarget.__init__(self) | |
self.window = window | |
def OnDropFiles(self, x, y, filenames): | |
for name in filenames: |
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 qrcode.image.base | |
BLACK = "\033[40m" | |
WHITE = "\033[107m" | |
DEFAULT = "\033[49m" | |
SPACER = " " | |
class CliImage(qrcode.image.base.BaseImage): | |
"""Cli image builder.""" |
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 | |
import SocketServer | |
import struct | |
import shutil | |
import hashlib | |
import zlib | |
from StringIO import StringIO | |
import os | |
try: | |
import wx |
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
class ThreadedMusicPlayer implements Runnable{ | |
public ThreadedMusicPlayer(){ | |
Thread thread = new Thread(this); | |
thread.start(); | |
} | |
void run(){ | |
while (true){ | |
playMusic(); | |
} |
OlderNewer