Skip to content

Instantly share code, notes, and snippets.

View j3j5's full-sized avatar
🤷‍♂️

Julio J. j3j5

🤷‍♂️
View GitHub Profile
@EdgeCaseBerg
EdgeCaseBerg / log_query.php
Last active September 14, 2016 21:00
Log SQL queries from WordPress
<?php
// in wordpress theme: functions.php add this in
function log_sql_queries($text_query){
/* //Uncomment me if you want a lot of info about where the sql query comes from and what action started it off
$traces = debug_backtrace();
$i = 0;
foreach ($traces as $tobj => $trace) {
if($trace['function'] == 'do_action'){
#!/usr/bin/php -Cq
<?php
$dir = isset($argv[1]) ? $argv[1] : __DIR__;
$skip = isset($argv[2]) ? intval($argv[2]) : 0;
$count = 0;
if(is_dir($dir)){
echo "Dir: {$dir}\n";
echo "Skip: {$skip} files\n";
class IgnorantRecursiveDirectoryIterator extends RecursiveDirectoryIterator {
@iolson
iolson / .env.example
Created September 17, 2015 22:14
GitLab CI Laravel 5.1.*
DB_HOST=mysql
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
@phpdude
phpdude / example.js
Last active June 9, 2018 20:14
PhantomJS: hellper for writing scripts waiting full page load (DOMContentLoaded event)
var system = require("system");
var url = system.args[1];
require('./phantom-full-load')(phantom, url, function (page, logs) {
logs.forEach(function (i) {
console.log('> ' + i);
});
result = page.evaluate(function () {
return $('body *').attr('class');
@d3v-null
d3v-null / cloak.ovpn
Last active June 28, 2018 00:00
This is an OpenVPN settings file for Cloak. Forked for compatibility the OpenVPN client in ASUS RT routers
client
dev tun
comp-lzo
auth-user-pass
# remote-cert-tls server
server-poll-timeout 10
auth-nocache
auth-retry interact
verb 1
remote openvpn.getcloakvpn.com 443 udp
@rafl
rafl / elasticsearch_cache
Created March 22, 2012 16:32
Munin ElasticSearch plugins
#!/usr/bin/env perl
# Parameters supported:
#
# config
# autoconf
#
# Magic markers:
#%# family=auto
#%# capabilities=autoconf
@tabacitu
tabacitu / gist:dbcfd71375e72c857474
Last active April 20, 2020 09:05
Tabacitu Laravel Package Service Provider boilerplate code
<?php
namespace League\Skeleton;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
class SkeletonServiceProvider extends ServiceProvider
{
/**
@snurhussein
snurhussein / PSPPConvert.md
Last active October 31, 2021 23:49
Using PSPP to convert sav files to csv

#Converting SPSS files to csv with PSPP#

Install and open PSPP Use the File menu to open your file (it probably has a .sav extension) Go to File>New>Syntax to open PSPP's command line window

Enter:

@alghanmi
alghanmi / render-md.py
Created January 25, 2013 08:43
Render a Markdown document using the GitHub markdown API
import argparse
import requests
import simplejson
def gitHubPost(text, mode, context):
"""Send a POST request to GitHub via API """
payload = {'text': text, 'mode':mode}
if context != None:
payload['context'] = context