Skip to content

Instantly share code, notes, and snippets.

View IgnacioCastro0713's full-sized avatar
:octocat:
Developer

José Ignacio Menchaca Castro IgnacioCastro0713

:octocat:
Developer
View GitHub Profile
@IgnacioCastro0713
IgnacioCastro0713 / DSM.vbs
Created May 5, 2025 14:34
Down system machine script
Dim objShell, lngMinutes, boolValid
Set objShell = CreateObject("WScript.Shell")
lngMinutes = InputBox("How long you want to keep your system awake?" & Replace(Space(5), " ", vbNewLine) & "Enter minutes:", "Awake Duration") 'we are replacing 5 spaces with new lines
If lngMinutes = vbEmpty Then 'If the user opts to cancel the process
'Do nothing
Else
On Error Resume Next
Err.Clear
boolValid = False
@karenpayneoregon
karenpayneoregon / someprojectfile.csproj
Last active February 7, 2024 19:33
reduced source path
<PropertyGroup>
<PathMap>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))=./</PathMap>
</PropertyGroup>
Simple contract or interface, call as you wish:
interface UnitOfWork
{
public function begin();
public function commit();
public function rollback();
}
@milannankov
milannankov / index.html
Created December 12, 2017 14:25
Add New Item to Kendo MultiSelect on Enter
<div id="example">
<div>
<h4>Choose products</h4>
<select id="products" style="width: 100%;"></select>
</div>
<script>
$(document).ready(function () {
@ba11b0y
ba11b0y / installing-postman.md
Last active December 4, 2024 19:25
Installing Postman on Ubuntu/Gnome

Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux

Although I highly recommend using a snap

sudo snap install postman

Installing Postman

tar -xzf Postman-linux-x64-5.3.2.tar.gz
@keithweaver
keithweaver / s3-file-upload.js
Last active August 21, 2024 13:31
S3 File Upload to AWS S3
const AWS = require('aws-sdk');
const Busboy = require('busboy');
const BUCKET_NAME = '';
const IAM_USER_KEY = '';
const IAM_USER_SECRET = '';
function uploadToS3(file) {
let s3bucket = new AWS.S3({
accessKeyId: IAM_USER_KEY,
@joshnuss
joshnuss / app.js
Last active February 18, 2025 15:49
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@BCasal
BCasal / Colaborar Proyecto GitHub.markdown
Last active April 7, 2025 11:45
Pasos a seguir para colaborar en un proyecto de GitHub

Cómo colaborar en un proyecto en GitHub

  • Fork del repositorio
  • Clonar el repositorio
  • Actualizar la rama master
  • Crear una rama
  • Hacer los cambios
  • Hacer un Pull Request

Fork del repositorio

@fractefactos
fractefactos / pivot_example.php
Last active October 17, 2022 08:47 — forked from lighta971/pivot_example.php
Laravel Custom Pivot Model definition example
<?php
//https://github.com/laravel/framework/issues/2093#issuecomment-39154456
use Illuminate\Database\Eloquent\Model as Eloquent;
use Illuminate\Database\Eloquent\Relations\Pivot;
class User extends Eloquent {
public function groups() {
return $this->belongsToMany('Group');
@DanDiplo
DanDiplo / JS-LINQ.js
Last active May 21, 2025 01:37
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },