This file contains hidden or 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
| # README |
This file contains hidden or 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
| function loadScript(src, cb) { | |
| var script = document.createElement('script'); | |
| script.async = true; | |
| script.src = src; | |
| script.onerror = function() { | |
| cb(new Error("Failed to load" + src)); | |
| }; | |
| script.onload = function() { |
This file contains hidden or 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 ctypes | |
| libc = ctypes.CDLL('libc.so.6') | |
| tzname = (ctypes.c_char_p * 2).in_dll(libc, 'tzname') | |
| for n in tzname: print(n) |
This file contains hidden or 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
| """ | |
| kombu.syn | |
| ========= | |
| :copyright: (c) 2009 - 2012 by Ask Solem. | |
| :license: BSD, see LICENSE for more details. | |
| """ | |
| from __future__ import absolute_import |
This file contains hidden or 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/perl | |
| use strict; | |
| use warnings; | |
| my @fgColors = ( | |
| 'default', 'bold', 'black', 'red', 'blue', 'yellow', 'green', | |
| 'majenta', 'cyan', 'white', 'bold black', 'bold red', 'bold blue', | |
| 'bold yellow', 'bold green', 'bold majenta', 'bold cyan', 'bold white'); |
This file contains hidden or 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
| # install initd script | |
| update-rc.d mysql-mirror defaults | |
| # create user for mirror (avoid mirror use main server and vice-versa) | |
| useradd -s /usr/sbin/nologin -r -M mysql-mirror | |
| # create the run directory | |
| install -m 755 -o mysql-mirror -g root -d /var/run/mysqld-mirror | |
| # create the log directory |
This file contains hidden or 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
| #!/bin/bash | |
| # http://cswarzone.com/ | |
| # TODO: change the paths | |
| cd /home/iuri/.local/share/wineprefixes/cs1.6/drive_c/Program\ Files\ \(x86\)/Counter-Strike/ | |
| WINEPREFIX=/home/iuri/.local/share/wineprefixes/cs1.6/ exec \ | |
| wine ./hl.exe \ | |
| -steam \ | |
| -game cstrike \ |
This file contains hidden or 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
| /************************************************************/ | |
| /* DAR 10 para todo professor/aluno */ | |
| var NOTA=10; | |
| var selects = document.querySelectorAll("select[name^=p_]"); | |
| for (var i=0; i < selects.length; i++) { | |
| var s = selects[i]; | |
| s.value = NOTA; | |
| } | |
| /* DAR 7 para todo professor/aluno */ |
This file contains hidden or 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 getattrfull(path): | |
| """ | |
| Obtem um atributo (objeto) de um caminho separado por '.', simulando um 'from xyz import y' | |
| Exemplo para simular um 'from os import name as sistema': | |
| >>> sistema = getattrfull('os.name') | |
| >>> sistema | |
| 'posix' | |
| Funciona para funcoes/classes/etc: |
This file contains hidden or 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 sqlalchemy import create_engine, Column, types | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.orm import sessionmaker, scoped_session | |
| from sqlalchemy.sql import functions, expression, func | |
| from sqlalchemy.ext.compiler import compiles | |
| from datetime import datetime | |
| Base = declarative_base() |