Skip to content

Instantly share code, notes, and snippets.

Avatar
🎃
Comiendo chaufita

KhalO KhanMaytok

🎃
Comiendo chaufita
View GitHub Profile
View 8reinaspatuconsumobb.c
// Problema de las N reinas
// ------------------------
// Algoritmo recursivo
//
// 0. Obviamente, colocaremos una reina en cada fila
//
// 1. Se coloca una reina en una casilla de su fila y,
// a continuación, se intentan colocar las reinas restantes.
//
View fhghg.txt
cd /d %ProgramFiles%\Microsoft Office\Office16
cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
for /f %x in ('dir /b ..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x"
cscript ospp.vbs /setprt:1688
cscript ospp.vbs /unpkey:6MWKP >nul
cscript ospp.vbs /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP
cscript ospp.vbs /sethst:kms8.msguides.com
cscript ospp.vbs /act
@KhanMaytok
KhanMaytok / postgres.sh
Last active Mar 19, 2022
postgres common operations
View postgres.sh
# Access console
sudo -u postgres psql
# Backup and restore database
su - postgres
pg_dump dbname > dbname.bak
# without owner
pg_dump database_name -O -x > output_file
View modal-recibir-masivo.component.html
<ng-container *ngIf="state$ | async as state" style="min-width: 860px !important;" id="container_ng_masivo">
<sunedu-modal-container [title]="'Aprobar en lote'"
[loading]="isLoading"
(on-dismiss)="handleClose()"
[msgErrors]="state.error"
(on-ok)="enviarMasivo()"
ok-label="Procesar"
cancelLabel="Cancelar" id="container_masivo">
<div class="row mb-4">
@KhanMaytok
KhanMaytok / particle-sphere.js
Created Dec 8, 2015
Create a sphere made of particles with Three.js
View particle-sphere.js
var distance = 100;
var geometry = new THREE.Geometry();
for (var i = 0; i < 1000; i++) {
var vertex = new THREE.Vector3();
var theta = THREE.Math.randFloatSpread(360);
var phi = THREE.Math.randFloatSpread(360);
View CorsFilter.java
package com.util;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
View constellations.css
/* CONSTELLATIONS CODED FROM PURE CSS BY GLENTHEMES */
/* DO NOT STEAL */
/* DO NOT COPY */
/* DO NOT REDISTRIBUTE */
/* PLEASE RESPECT CODERS */
.aries-orb-1,.aries-orb-2,.aries-orb-3,.aries-orb-4,.aries-orb-5,.aries-orb-6{position:absolute;bottom:0;width:5px;height:5px;border-radius:100%}.aries-orb-2{bottom:20px;left:20px}.aries-orb-3{bottom:70px;left:43px}.aries-orb-4{bottom:50px;left:130px}.aries-orb-5{bottom:25px;left:150px}.aries-orb-6{bottom:10px;left:155px}.aries-line-1,.aries-line-2,.aries-line-3,.aries-line-4,.aries-line-5{position:absolute;height:1px;transform-origin:0 100%;opacity:.8}.aries-line-1{bottom:1px;left:1px;width:29px;transform:rotate(-44deg)}.aries-line-2{bottom:24px;left:24px;width:55px;transform:rotate(-66deg)}.aries-line-3{bottom:72px;left:45px;width:89px;transform:rotate(13deg)}.aries-line-4{bottom:52px;left:132px;width:32px;transform:rotate(51deg)}.aries-line-5{bottom:25px;left:153px;width:16px;transform:rotate(70deg)}.taurus-orb-1,.taurus-orb-10,.taurus-orb-2,.taurus-orb-3,.tauru
View snippets.py
# Select with today date
# timezone.now().today()
today = date.today()
invoice_for_today = Invoice.objects.filter(date__year=today.year, date__month=today.month, date__day=today.day)
View snippets.py
# Select with today date
# timezone.now().today()
today = date.today()
invoice_for_today = Invoice.objects.filter(date__year=today.year, date__month=today.month, date__day=today.day)
@KhanMaytok
KhanMaytok / functions.php
Created Jun 26, 2015
Get Editor capanilities to manage users
View functions.php
/*
* Let Editors manage users, and run this only once.
*/
function isa_editor_manage_users() {
if ( get_option( 'isa_add_cap_editor_once' ) != 'done' ) {
// let editor manage users
$edit_editor = get_role('editor'); // Get the user role