Skip to content

Instantly share code, notes, and snippets.

View hightemp's full-sized avatar
🎯
Focusing

Anton Panov hightemp

🎯
Focusing
View GitHub Profile
@hightemp
hightemp / file_get_contents.php
Created May 13, 2019 11:42 — forked from tdebatty/file_get_contents.php
file_get_contents with proxy support
<?php
$context = array();
$proxy = getenv("http_proxy");
if ($proxy !== null) {
$context['http'] = array(
'proxy' => str_replace("http", "tcp", $proxy),
'request_fulluri' => true
);
}
@hightemp
hightemp / gist:d858159abae065d26c1bca6194574c64
Created May 13, 2019 07:46 — forked from mackstann/gist:4229933
Gigantic recursive directory lister
// http://www.olark.com/spw/2011/08/you-can-list-a-directory-with-8-million-files-but-not-with-ls/
#define _GNU_SOURCE
#include <dirent.h> /* Defines DT_* constants */
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/syscall.h>
@hightemp
hightemp / git-deployment.md
Created May 7, 2019 11:52 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@hightemp
hightemp / README.md
Created May 4, 2019 17:55 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@hightemp
hightemp / EloquentCheatSheet.md
Created March 22, 2019 11:08 — forked from avataru/EloquentCheatSheet.md
Eloquent relationships cheat sheet
#!/bin/bash
PROGNAME=${0##*/}
INPUT=''
QUIET='0'
NOSTATS='0'
max_input_size=0
max_output_size=0
usage()
@hightemp
hightemp / minify_function.php
Created July 16, 2018 01:17 — forked from dr-dimitru/minify_function.php
HTML MINIFY RegEx
$re = '%# Collapse whitespace everywhere but in blacklisted elements.
(?> # Match all whitespans other than single space.
[^\S ]\s* # Either one [\t\r\n\f\v] and zero or more ws,
| \s{2,} # or two or more consecutive-any-whitespace.
) # Note: The remaining regex consumes no text at all...
(?= # Ensure we are not in a blacklist tag.
[^<]*+ # Either zero or more non-"<" {normal*}
(?: # Begin {(special normal*)*} construct
< # or a < starting a non-blacklist tag.
(?!/?(?:textarea|pre|script)\b)
@hightemp
hightemp / qtyaml.h
Last active June 15, 2017 05:32 — forked from brcha/qtyaml.h
[Cpp][Qt][Yaml] QtYaml support using yaml-cpp library
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* ***** END LICENSE BLOCK ***** */
/*
@hightemp
hightemp / StatusIcon.py
Last active June 7, 2017 05:25 — forked from pklaus/StatusIcon.py
[Python][GTK] StatusIcon – A Simple Tray Icon Application Using PyGTK
#!/usr/bin/env python
# found on <http://files.majorsilence.com/rubbish/pygtk-book/pygtk-notebook-html/pygtk-notebook-latest.html#SECTION00430000000000000000>
# simple example of a tray icon application using PyGTK
import gtk
def message(data=None):
"Function to display messages to the user."
@hightemp
hightemp / 32.asm
Last active June 6, 2017 05:54 — forked from FiloSottile/32.asm
[Assembler][NASM] Hello World for x86 and x86_64 Intel Mac OS X(get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4