Skip to content

Instantly share code, notes, and snippets.

View vitaminac's full-sized avatar
🎯
Focusing

ShuXiang Gao vitaminac

🎯
Focusing
View GitHub Profile
@vitaminac
vitaminac / saySorry.js
Created November 19, 2017 11:12
say sorry using javascript
(function saySorry () {
const start = 1;
const maxIteration = 10000;
const timeInitial = performance.now();
const nth = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
const nunit = ["万", "亿"].reduce((units, unitGroup) => units.concat(units.map((unit) => unit + unitGroup)), ["", "十", "百", "千"]);
const filename = "检查书.txt";
const sorry = [];
for (let i = start; i < maxIteration; i++) {
sorry.push(`对不起 第${Array.from(i.toString())
PROGRAM aparcamiento;
{**************************TIPO DE DATOS*********************************}
CONST
LONGMATRICULA = 7; {longitud matricula}
NUMCARMARCA = 15; {numero caracteres campo marca}
NUMCARCOLOR = 20; {numero caracteres campo color}
LONGTELEFONO = 9; {longitud telefono}
LONGDNI = 9; {longitud dni}
MAXVEHICULOS = 100; {numero maximo de vehiculos}
MAXCONDUCTORES = 100; {numero maximo de conductores}
@vitaminac
vitaminac / Vagrantfile
Created June 28, 2018 20:03
Vagrant configuration for odoo-prestashop-php-apache-MySQL
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
// ==UserScript==
// @name ddcatDebug
// @namespace ddcatDebug
// @description ddcatDebug
// @include *
// @version 1
// @require https://code.jquery.com/jquery-3.2.1.js
// @require https://rawgit.com/kriskowal/q/master/q.js
// @require https://rawgit.com/mgalante/jquery.redirect/master/jquery.redirect.js
// @require https://rawgit.com/ilinsky/jquery-xpath/master/jquery.xpath.js
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define NMAX 10 //numero maximo de filas y de columnas
#define NMAXCASILLAS 20 //cantidad de casillas x 4*1+3*2+2*3+1*4
void GRAFICAR_T(char Tablero[NMAX][NMAX],int de_quien_es);
void INICIAR_TABLERO(char Tablero[NMAX][NMAX]);
//colocar barco
@vitaminac
vitaminac / 狐妖小红娘漫画下载.py
Last active December 26, 2021 15:04
狐妖小红娘漫画下载
import asyncio
import errno
import json
import os
import re
from base64 import b64decode
from re import compile
import aiohttp
import bs4
@vitaminac
vitaminac / SendGmail.java
Created July 14, 2018 00:26
enviar los emailes con la cuenta de gmail
import com.sun.mail.smtp.SMTPTransport;
import com.sun.mail.util.BASE64EncoderStream;
import org.json.JSONObject;
import javax.mail.Message;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
@vitaminac
vitaminac / IEEE724.py
Created August 26, 2018 19:41
la representacion IEEE724 de un float
# coding=utf-8
import ctypes, struct
from ctypes import c_uint, c_uint64, c_int64, c_uint32, c_ulong
class IEEE764F(ctypes.Structure):
_fields_ = [("mantissa", c_uint32, 23),
("exponent", c_uint32, 8),
("sign", c_uint32, 1)]
@vitaminac
vitaminac / EmailTemplate.html
Created August 31, 2018 20:27
gmail oauth access
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<button id="openGrantPage" type="button">Click Me!</button>
<script>
document.getElementById("openGrantPage").onclick = function () {
@vitaminac
vitaminac / oracle-kill-all-session.sql
Created February 15, 2019 10:32
script to kill all session in oracle
BEGIN
FOR R IN (
SELECT
SID,
SERIAL#
FROM V$SESSION
WHERE USERNAME IS NOT NULL AND SID <> (
SELECT sys_context('USERENV', 'SID')
FROM DUAL))
LOOP EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION ''' || R.SID || ',' || R.SERIAL# || '''';