Skip to content

Instantly share code, notes, and snippets.

View IngwiePhoenix's full-sized avatar
💭
Working on IngwiePhoenix/IceTea ... trying out a JavaScript aproach. O.o...

Ingwie Phoenix IngwiePhoenix

💭
Working on IngwiePhoenix/IceTea ... trying out a JavaScript aproach. O.o...
View GitHub Profile
@IngwiePhoenix
IngwiePhoenix / rätzel.txt
Last active August 29, 2015 14:01
Ein kleines, typisches, Rätzel, welches sich einem Programmierer hin und wieder stellt. Demonstriert String management in C.
In einem C programm muss folgender String in zwei Teile zerlegt werden:
key=value
Die Schleifenfunktion kann bereits alles bis zu key= erkennen, und kennt zusätzlich die Gesamtlänge des Strings (9). Auch ist die Länge der ersten Hälfte als "y" gebeben - in diesem Falle ist also y=3. Da der Wert "value" in einen anderen Speicherblock geschrieben werden muss, muss von 0 angefangen werden zu zählen. Es soll also folgendes entstehen:
Vorher:
input: key=value
Nachher:
Links: key
../ocgcore/interpreter.cpp:631:29: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
libcard.cpp
libdebug.cpp
libduel.cpp
libeffect.cpp
libgroup.cpp
mem.cpp
ocgapi.cpp
operations.cpp
playerop.cpp
@IngwiePhoenix
IngwiePhoenix / resp.json
Created September 4, 2014 23:34
Response given to gitlabhooks callback
{
"after":"26cb00f9109b35a44ca9fc77fbe6e66e2843ddc1",
"before":"ec77cefe521f51b1dd87d5f53ee8263a923deec8",
"commits":[
{
"author":{
"email":"ingwie2000@googlemail.com",
"name":"Ingwie Phoenix"
},
"id":"26cb00f9109b35a44ca9fc77fbe6e66e2843ddc1",
@IngwiePhoenix
IngwiePhoenix / 01_tester.fish
Last active August 29, 2015 14:18
Testing the upload capability of node-fastcgi-parser
#!/usr/bin/env fish
# This shell is much more confortable for me, but you should be understanding what I am doing here.
function genfile
command base64 /dev/urandom | head -c (math "1024*$argv[1]") > $argv[2]
end
for x in (seq 1 1024)
echo -n $x"k : "
genfile $x text.txt; and curl -4 -H "Connection: close" -F "img=@text.txt" http://localhost:8080/test.php
@IngwiePhoenix
IngwiePhoenix / main.js
Last active August 29, 2015 14:19
WebPack and OJ aren't behaving well. Showcasing issue I am having.
webpackJsonp([0,1],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(1);
__webpack_require__(2);
__webpack_require__(3);
console.log("main.js");

WebPack+Uniter

During the processing of any .php OR .uniter.php file, the first-found composer.lock file will be loaded. It will be used to create a map of namespaces and files, allowing us to emulate the autoloader during the static analysis.

To track dependencies:

  • Look for use statements.
  • Look for new statements.

For a brief example, consider the following:

<?php
// includes
include "WebSocket.php";
class Process extends Thread {
public $proc;
public $pipes=array();
public $spec=array();
public $programm;
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.0
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
PHP_ARG_ENABLE(easywsclient,
[Whether to enable the "easywsclient" extension],
[ --enable-easywsclient Enable easywsclient.])
if test $PHP_EASYWSCLIENT != "no"; then
PHP_REQUIRE_CXX()
PHP_SUBST(EASYWSCLIENT_SHARED_LIBADD)
PHP_ADD_LIBRARY(stdc++, 1, EASYWSCLIENT_SHARED_LIBADD)
PHP_NEW_EXTENSION(easywsclient, easywsclient.cpp easywsclient_wrap.c, $ext_shared)
fi
@IngwiePhoenix
IngwiePhoenix / main.css
Created December 27, 2015 09:25
PurifyCSS
/*! ________ ___________ ________
`MMMMMMMb.`MM`MMMMMMMb. `MMMMMMMb.
MM `Mb MM MM `Mb MM `Mb
MM MM MM MM MM MM MM ____
MM .M9 MM MM MM MM MM 6MMMMb
MMMMMMM( MM MM .M9 MM MM MM' `Mb
MM `Mb MM MMMMMMM9' MM MM MM
MM MM MM MM \M\ MM MM .M9
MM MM MM MM \M\ MM MM MMMM
MM .M9 MM MM \M\ MM .M9 `Mb