Skip to content

Instantly share code, notes, and snippets.

🐟
摸鱼中

PRIN.T printempw

🐟
摸鱼中
Block or report user

Report or block printempw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@printempw
printempw / gist:0e900c2e2fdd034aac5c
Created Aug 12, 2015
shadowsocks one-key install shell
View gist:0e900c2e2fdd034aac5c
#! /bin/bash
#==================================
# AUTHOR: printempw
# NOTE: I HAVEN'T WRITE ANY DEBUG CODE IN THIS SHELL,
# IF ANY ERROR RAISES,UMM,JUST LET IT GO
# SYSTEM REQUIRED: ONLY FOR UBUNTU
#==================================
clear
echo ""
View gist:689a1da4b515aa682d4b
#!/usr/bin/env python
# -*- coding=utf-8 -*-
art_dict = {}
def getArtLines(ascii):
lineNumberStart = (ascii - 64 - 1)*3 + 1
result = []
lines = ['┌─┐', '├─┤', '┴ ┴', '┬┐ ', '├┴┐', '┴─┘', '┌─┐', '', '└─┘', '┬─┐', '│ │', '┴─┘', '┌─┐', '├┤ ', '└─┘', '┬─┐', '├┤ ', '', '┌─┐', '│ ┐', '└─┘', '┬ ┬', '├─┤', '┴ ┴', '', '', '', '', '', '└┘ ', '┐┌ ', '├┴┐', '┴ ┴', '', '', '┴─┘', '┌┬┐', '│││', '┴ ┴', '┌┐┌', '│││', '┘└┘', '┌─┐', '│ │', '└─┘', '┬─┐', '├─┘', '', '┌─┐', '│ │', '└─┴', '┬─┐', '├┬┘', '┴└─', '┌─┐', '└─┐', '└─┘', '┌┬┐', '', '', '┐ ┌', '│ │', '└─┘', '┐ ┌', '└┐│', ' └┘', '┬ ┬', '│││', '└┴┘', '┬ ┬', '└┬┘', '┴ ┴', '┬ ┬', '└─┤', '└─┘', '┌─┐', '┌─┘', '└─┘']
for i in range(3):
@printempw
printempw / convert.php
Last active Feb 1, 2016
Convert data of WP-PostViews to fit custom page counter of Ghost
View convert.php
<?php
/**
* @Author: printempw
* @Date: 2016-02-01 20:37:43
* @Last Modified by: prpr
* @Last Modified time: 2016-02-01 22:10:06
*
* Configure your database connection info here.
* $wp_conn for WordPress installation database,
* $ghost_conn for which you place `post_views` table in.
@printempw
printempw / autoloader.php
Last active Mar 18, 2016
Autoload PHP namespace
View autoloader.php
<?php
function __autoload($classname) {
$dir = dirname(__FILE__);
$include_dir = $dir.DIRECTORY_SEPARATOR."includes".DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR;
$filename = $include_dir.str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.class.php';
require_once($filename);
}
View like.php
<?php
/* MySQL 数据库名称 */
define('DB_NAME', 'wordpress');
/* MySQL 数据库用户名 */
define('DB_USER', 'root');
/* MySQL 数据库密码 */
define('DB_PASSWD', 'root');
@printempw
printempw / example.php
Created Jul 12, 2016
PHP function reload example
View example.php
<?php
class Shit
{
/**
* Function reload
*/
public static function fuck()
{
$args = func_get_args();
@printempw
printempw / aplayer.js
Last active Jul 25, 2016
Generate playlist config for APlayer from netease music automatically
View aplayer.js
/*
* @Author: printempw
* @Date: 2016-07-25 13:03:12
* @Last Modified by: printempw
* @Last Modified time: 2016-07-25 14:51:29
*/
var superagent = require('superagent');
// fill your ids here
@printempw
printempw / autoload.js
Last active Aug 5, 2016
Add page view counter for Ghost blog
View autoload.js
/**
* Add to $(document).ready()
* Will auto load page view for each post on the page
*/
$('[id=post-view]').each(function(){
url = 'http://127.0.0.1/count.php?action=get&slug='+$(this).attr('data').slice(1,-1);
var span = $(this);
$.getJSON(url, function(data) {
span.html(data.count);
});
View PluginManager.php
<?php
namespace App\Services;
use Illuminate\Support\Arr;
use App\Events\PluginWasEnabled;
use App\Events\PluginWasDisabled;
use Illuminate\Support\Collection;
use App\Events\PluginWasUninstalled;
use Illuminate\Filesystem\Filesystem;
View plugin-autoload.php
<?php
public function boot(PluginManager $plugins)
{
// store paths of class files of plugins
$src_paths = [];
foreach ($plugins->getPlugins() as $plugin) {
$src_paths[$plugin->getNameSpace()] = $plugin->getPath()."/src";
}
You can’t perform that action at this time.