Skip to content

Instantly share code, notes, and snippets.

View name-k's full-sized avatar
💢

Mykhailo Pronin name-k

💢
  • Nuix
  • Homeless
View GitHub Profile
@name-k
name-k / php - Random file includ from path-to-folder
Created June 20, 2014 20:54
php - Random file includ from path-to-folder
<?php
$path = '/path/to/directory/'; // remeber trailing slash!
$handle = opendir ($path);
while (($filename = readdir ($handle)) !== false)
{
if ($filename != '.' && $filename != '..')
{
$file_array[] = $filename;
}
}
@name-k
name-k / conemu.py
Last active August 29, 2015 14:17 — forked from batandwa/conemu.py
import sublime, sublime_plugin, os, subprocess
class ConemuCommand(sublime_plugin.TextCommand):
def run(self, edit):
if os.name == "nt":
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
process = subprocess.Popen(('c:/Program Files (x86)/ConEmu/ConEmu.exe', '/single', self.view.file_name()),
@name-k
name-k / ContentEditableLabel.js
Last active August 29, 2015 14:26 — forked from andrewgleave/ContentEditableLabel.js
An editable React.js label element based on the contenteditable attribute
/** @jsx React.DOM */
'use strict';
var React = require('react');
var ContentEditableLabel = React.createClass({
propTypes: {
tag: React.PropTypes.func,