Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Gabor Javorszky javorszky

🏠
Working from home
View GitHub Profile
@javorszky
javorszky / colortest.sh
Created Mar 16, 2021
small sh file to test coloring in terminals, 16 colors
View colortest.sh
#!/bin/sh
echo "\033[30m Black"
echo "AAAAAAAAAAA"
echo ""
echo "\033[31m Red"
echo "AAAAAAAAAAA"
echo ""
echo "\033[32m Green"
echo "AAAAAAAAAAA"
@javorszky
javorszky / wordpress-plugin-svn-to-git.md
Created Jul 11, 2017 — forked from kasparsd/wordpress-plugin-svn-to-git.md
Using Git with Subversion Mirroring for WordPress Plugin Development
View wordpress-plugin-svn-to-git.md
View glotpress_permissions.php
<?php
array(
'/' => array('GP_Route_Index', 'index'),
/**
* No permission check
*/
@javorszky
javorszky / create-wp-admin-account.sql
Created Oct 14, 2015 — forked from azizur/create-wp-admin-account.sql
Create a WordPress Administrator user account using SQL
View create-wp-admin-account.sql
USE __DATABASE__;
SET @username = 'azizur';
SET @password = MD5('password');
SET @fullname = 'Azizur Rahman';
SET @email = 'azizur@example.com';
SET @url = 'http://azizur.com/';
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_status`, `display_name`) VALUES (@username, @password, @fullname, @email, @url, NOW(), '0', @fullname);
View javascript.apply.js
var foo = function () {
return this;
},
a = new foo(),
b = foo.apply({});
console.log(a); // {}
console.log(b); // {}
a == b // false
@javorszky
javorszky / simpviews.php
Last active Aug 29, 2015
This is the entire php code of the simpleviews plugin. I'm posting it here, because I need it repaired for a project, and the plugin doesn't have a github repository. Plugin url: http://wordpress.org/plugins/simple-post-views-counter/
View simpviews.php
<?php
/*
Plugin Name: Simple Post Views Counter
Plugin URI: http://wordpress.org/extend/plugins/simple-post-views-counter/
Description: This plugin will enable you to display how many times a post has been viewed. The hits/views are displayed in the posts entry meta. Please refer to the included readme file for proper install instructions and use.
Version: 1.2
Author: RS Publishing
License: GPLv2
*/
View pcre_url_pattern.php
<?php
$urlPattern = '/^(?!mailto:)(?:(?:https?):\/\/)(?:\S+(?::\S*)?@)?(?:(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[0-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:www.)?)?(?:(?:[a-z\x{00a1}-\x{ffff}0-9]+-?-?_?)*[a-z\x{00a1}-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]+-?-?_?)*[a-z\x{00a1}-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,})))|localhost)(?::(\d{1,5}))?(?:(?:\/|\?|#)[^\s]*)?$/iu';
View gist:25974e99e56511cb1703
$(document).ready(function(){
setInterval(countdomains(), 1000);
function countdomains(){
var cb;
$(".letters").each(function(){
cb = $(this);
$.getJSON("/api/domain/countByLetter?letter="+$(this).data('letter'), null, function(data){
cb.text(data);
});
});
View gist:7093875951b057827f71
<?php
/*
* This is the contents of $_SESSION
* Array
* (
* [qty] => 3
* [sizes] => Array
* (
* [0] => 10-x-12-x-1
* [1] => 10-x-12-x-1
View keybase.md

Keybase proof

I hereby claim:

  • I am javorszky on github.
  • I am javorszky (https://keybase.io/javorszky) on keybase.
  • I have a public key whose fingerprint is 40FB C961 9B8E 2647 C406 0D4C 17D5 290D 17F9 7DA8

To claim this, I am signing this object: