Skip to content

Instantly share code, notes, and snippets.

View AlexDev404's full-sized avatar
👾
Ruby2D!

Immanuel Daviel A. Garcia AlexDev404

👾
Ruby2D!
View GitHub Profile
@stefafafan
stefafafan / calloc
Created October 12, 2013 04:00
calloc implementation
void *calloc(size_t nmemb, size_t size)
{
char *p;
// If either is zero just return NULL.
if (nmemb == 0 || size == 0)
{
return NULL;
}
@lowfront
lowfront / electron-prevent-zorder-change.js
Last active January 26, 2022 01:05
WM_WINDOWPOSCHANGING Message Handler for Electron Application, which is always fixed on the floor.
// Node.js & Electron reference : https://stackoverflow.com/a/58473299
// C++ reference : https://stackoverflow.com/a/65052538
// Environment:
// - Windows 10
// - Nodejs v14.17.6
// Dependencies:
// - electron@14.0.1
// - ref-napi@3.0.3
// - ref-struct-di@1.1.1
// - win-setwindowpos@2.1.0
@entaq
entaq / Google_oAuth.js
Created November 15, 2012 17:18
Google oAuth 2.0 sample
/**
reference -
https://developers.google.com/accounts/docs/OAuth2WebServer
https://code.google.com/apis/console/
https://developers.google.com/+/api/latest/
**/
////handle all requests here
function doGet(e) {
@sheharyarn
sheharyarn / bash-boilerplate.sh
Created October 29, 2016 21:51
Bash Script Boilerplate code
#!/usr/bin/env bash
# Bash3 Boilerplate. Copyright (c) 2014, kvz.io
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
# Set magic variables for current file & dir
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@mickeypash
mickeypash / web-whatsapp.js
Created May 7, 2016 21:35
This is the javascript process running the web client for whatsapp
This file has been truncated, but you can view the full file.
/*! Copyright (c) 2015 WhatsApp Inc. All Rights Reserved. */
webpackJsonp([84], [, function(e, t, r) {
"use strict";
function n() {
return u[Math.round(Math.random() * (u.length - 1))]
}
function o() {
this.logs = [], this.localCursor = 0, this.pending = void 0, this.timer = new d(this, this.persistIdb)
@infinitylx
infinitylx / file_list_downloader.py
Created April 3, 2014 10:23
Download files from file with list of urls.
import os
import urllib2, posixpath, urlparse
DOWNLOADS_DIR = './mp3'
# For every line in the file
for url in open('list.urls'):
resp = urllib2.urlopen(url)
# Split on the rightmost / and take everything on the right side of that
name = urllib2.unquote(posixpath.basename(urlparse.urlsplit(resp.url).path))
@SgtPooki
SgtPooki / stashConflictExample
Created July 3, 2014 12:08
stash conflict example
07:01:38 /var/projects
$ mkdir gitStashConflictExample
07:01:53 /var/projects
$ cd gitStashConflictExample/
07:01:55 /var/projects/gitStashConflictExample
$ git init
Initialized empty Git repository in /var/projects/gitStashConflictExample/.git/
@AlexDev404
AlexDev404 / elf.c
Created December 16, 2022 21:14
ToAru OS Kernel - ELF Loader
/* vim: tabstop=4 shiftwidth=4 noexpandtab
*
* ELF Static Executable Loader
*
* Part of the ToAru OS Kernel
* (C) 2011 Kevin Lange
* Released under the terms of the NCSA License, see the included
* README file for further information.
*/
/************************
* validationEngaged.js *
************************
*
* They're really on to us now! The validateLevel function
* has been activated to enforce constraints on what you can
* do. In this case, you're not allowed to remove any blocks.
*
* They're doing all they can to keep you here. But you
* can still outsmart them.