Skip to content

Instantly share code, notes, and snippets.

View lihas's full-sized avatar
💭
OpenGL

sahil lihas

💭
OpenGL
View GitHub Profile
@lihas
lihas / git-cache-meta.sh
Created August 20, 2016 12:04 — forked from andris9/git-cache-meta.sh
git-cache-meta
#!/bin/sh -e
#git-cache-meta -- simple file meta data caching and applying.
#Simpler than etckeeper, metastore, setgitperms, etc.
#from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694
#modified by n1k
# - save all files metadata not only from other users
# - save numeric uid and gid
# 2012-03-05 - added filetime, andris9
@lihas
lihas / sparsify.c
Created August 21, 2016 18:47 — forked from kempniu/sparsify.c
sparsify - copy non-zero blocks of data from source to destination
/*
***********************************************************************
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* Version 2, December 2004
*
* Copyright (C) 2004 Sam Hocevar <[email protected]>
*
* Everyone is permitted to copy and distribute verbatim or modified
* copies of this license document, and changing it is allowed as long
@lihas
lihas / 0_reuse_code.js
Created September 24, 2016 19:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lihas
lihas / RegisterDLL.ps1
Created July 28, 2017 19:23 — forked from nylyst/RegisterDLL.ps1
Powershell to register a dll without regsvr32.exe
$registerDLL = @"
namespace RegisterDLL {
using System;
using System.Runtime.InteropServices;
public static class Kernel32 {
[DllImport("kernel32", SetLastError=true, CharSet = CharSet.Ansi)]
public static extern IntPtr LoadLibrary([MarshalAs(UnmanagedType.LPStr)]string lpFileName);
[DllImport("kernel32", CharSet=CharSet.Ansi, ExactSpelling=true, SetLastError=true)]
@lihas
lihas / usb.cpp
Created June 6, 2018 09:18 — forked from gabonator/usb.cpp
USB enumerating tools
#include "usb.h"
#ifndef DISABLE_USB
#pragma comment(lib, "setupapi.lib")
#include "SetupAPI.h"
#include "cfgmgr32.h"
#pragma pack(4)