Skip to content

Instantly share code, notes, and snippets.

View h3xxx's full-sized avatar
:octocat:
hello :trollface: 💻 :hurtrealbad:

Roger Bonin h3xxx

:octocat:
hello :trollface: 💻 :hurtrealbad:
View GitHub Profile
@h3xxx
h3xxx / windows-cmds-aliases.bat
Created May 22, 2018 16:40
Windows commands aliases
@echo off
DOSKEY ls=dir /B
DOSKEY lsport=netstat -a -n -o | find "%1"
@h3xxx
h3xxx / ajax-promise.js
Created March 21, 2017 13:27
Ajax-Promise solution
// taken from https://medium.com/front-end-hacking/ajax-async-callback-promise-e98f8074ebd7#.55p53btpl
function makeAjaxCall(url, methodType){
var promiseObj = new Promise(function(resolve, reject){
var xhr = new XMLHttpRequest();
xhr.open(methodType, url, true);
xhr.send();
xhr.onreadystatechange = function(){
if (xhr.readyState === 4){
if (xhr.status === 200){
@h3xxx
h3xxx / DAWs_And_Their_Users.txt
Created June 6, 2016 11:15
DAWs And Their Users
SRC: http://vi-control.net/community/threads/daw-users-poll-and-the-who-uses-what-list.35147/
EDIT: The poll results were erased when moved to the new VI-C site in 2015, rendering it useless. Newer polls have emerged since.
Please feel free to add to the list, and provide a source if you can.
NOTE: These are DAWs used as the "primary composition and sequencing software". The 'Desert Island' DAW.
DAWs And Their Users
==============
@h3xxx
h3xxx / imgur.sh
Created May 20, 2016 22:22 — forked from 0xAether/imgur.sh
A script that scrapes the image hosting website imgur.com
#!/usr/bin/env bash
while [ 1 == 1 ]
do
##########################################################################
url=$(cat /dev/urandom | tr -cd "[:alnum:]" | head -c 5)
curl -f -s http://imgur.com/$url > /dev/null
exitstatus=$?
@h3xxx
h3xxx / 4chan.sh
Created May 20, 2016 22:21 — forked from 0xAether/4chan.sh
A bash function to download all the images in a 4chan thread
function 4chan() {
if [ $# -ne 1 ]
then
echo 'No URL specified! Give the URL to thread as the ONLY argument'
return 1
fi
url=$1
var Timeout = {
_timeouts: {},
set: function(name, func, time){
this.clear(name);
this._timeouts[name] = {pending: true, func: func};
var tobj = this._timeouts[name];
tobj.timeout = setTimeout(function()
{
/* setTimeout normally passes an accuracy report on some browsers, this just forwards that. */
tobj.func.call(arguments);
@h3xxx
h3xxx / server-status.py
Created March 15, 2016 15:47
CGI script in Python for executing predefined commands
#!/usr/bin/python
import cgi, cgitb, os, sys
import commands
cgitb.enable(); # formats errors in HTML
form = cgi.FieldStorage()
sys.stderr = sys.stdout
print "Content-type: text/html"
print
@h3xxx
h3xxx / index.html
Created March 3, 2016 08:02
A Basic HTML5 Template For Any Project
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 Template</title>
<meta name="description" content="HTML5">
<meta name="author" content="Author">
@h3xxx
h3xxx / dev_console.js
Created January 13, 2016 10:33
Snippet for clear JS console.
// taken from http://stackoverflow.com/questions/3011600/clear-javascript-console-in-google-chrome
if (typeof console._commandLineAPI !== 'undefined') {
console.API = console._commandLineAPI;
} else if (typeof console._inspectorCommandLineAPI !== 'undefined') {
console.API = console._inspectorCommandLineAPI;
} else if (typeof console.clear !== 'undefined') {
console.API = console;
}
@h3xxx
h3xxx / opacit_visibility_display_diffs.txt
Created January 12, 2016 10:15
CSS opacit, visibility and display differences.
collapse events taborder
opacity: 0 No Yes Yes
visibility: hidden No No No
visibility: collapse * No No
display: none Yes No No
* Yes inside a table element, otherwise No.
taken from http://stackoverflow.com/questions/272360/does-opacity0-have-exactly-the-same-effect-as-visibilityhidden