Skip to content

Instantly share code, notes, and snippets.

View mrexclamation's full-sized avatar

Mr. Exclamation mrexclamation

View GitHub Profile
@mrexclamation
mrexclamation / dv-dian.js
Last active December 20, 2016 16:44
Script para generar el Digito de Verificacion de Nits o Cedulas de la DIAN Colombia
function GeneraDV(nit) {
var aPeso = [ 71, 67, 59, 53, 47, 43, 41, 37, 29, 23, 19, 17, 13, 7, 3 ];
if (typeof nit !== "string") { throw new Error("El NIT debe ser una cadena de texto"); }
// Limpiar Espacios, Comas, Puntos, Guiones y Comillas
nit = nit.replace( /\s/g,"").replace(/,/g,"").replace(/\./g,"").replace (/-/g,"").replace(/'/g,"");
if (isNaN(nit)) {
throw new Error("El NIT contiene caracteres especiales");
-----BEGIN CERTIFICATE-----
MIIFdjCCBF6gAwIBAgIQLWUbaFQoVZJC66sI/OmUYDANBgkqhkiG9w0BAQsFADBC
MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMS
UmFwaWRTU0wgU0hBMjU2IENBMB4XDTE2MTAxNzAwMDAwMFoXDTE3MTIxNjIzNTk1
OVowHDEaMBgGA1UEAwwRKi5jeWFub2dlbm1vZC5vcmcwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDWt4Dago3bImFNveaCM/u0doRLKNfifCv6J8UOhQtX
XoTqjG0Yp/9d+1jz7utq0H4lRs4vIYbJarkZ8gRC1NlZPHy6DIE+a8x/nWF2SIul
TRpGSJUIzSfpejjGfWOIbo4cQi/cIEmdsb2YPWJc5nKdweUS4pJ+ETESehbQLAr0
23NZzzgJe7GzdlVZVFQEpIaOsWZ7tY0tQHFm83yxAG1zTqPANB8ChEKFieRKevRm
77s/7GzkL2ap6CwQ3k2EprobjefKRSxu9gVBMIn/y5+Az04IY7i26APibx11B/ZG
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remove-project name="CyanogenMod/android_packages_apps_CMUpdater" />
<project name="mparus/android_device_huawei_g760-caf" path="device/huawei/g760" revision="master" />
<project name="mparus/android_kernel_huawei_msm8916-caf" path="kernel/huawei/msm8916" revision="cm-13.0" />
<project name="mparus/android_vendor_huawei_g760-caf" path="vendor/huawei/g760" revision="master" />
<project name="CyanogenMod/android_device_qcom_common" path="device/qcom/common" revision="cm-13.0" />
<!--<project name="CyanogenMod/android_hardware_qcom_fm" path="hardware/qcom/fm" remote="github" />-->
</manifest>
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 581a5ae..6be0aa5 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -67,7 +67,7 @@
g_webcam-y := webcam.o
g_ncm-y := ncm.o
g_acm_ms-y := acm_ms.o
-g_android-y := android.o
+g_android-y := android.o f_hid.o
@mrexclamation
mrexclamation / README.md
Last active September 17, 2016 15:44
Symfony3 Setting up or Fixing File Permissions Using ACL on a System that Supports setfacl BASH SCRIPT
  1. Save the file as fixsysperms.sh
  2. Set execution permission: $ chmod +x fixsymperms.sh
  3. If you want to use it globally: $ sudo cp fixsymperms.sh /usr/local/bin/fixsymperms
@mrexclamation
mrexclamation / NPerGroup.php
Last active December 19, 2017 14:07
Enhanced version of https://softonsofa.com/tweaking-eloquent-relations-how-to-get-n-related-models-per-parent/, tested on hasMany and belongsToMany relationships
<?php
namespace App\Traits;
trait NPerGroup {
/**
* query scope nPerGroup
*
* @return void
*/