Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View javorszky's full-sized avatar
🏠
Working from home

Gabor Javorszky javorszky

🏠
Working from home
View GitHub Profile
@javorszky
javorszky / wordpress-plugin-svn-to-git.md
Created July 11, 2017 12:47 — forked from kasparsd/wordpress-plugin-svn-to-git.md
Using Git with Subversion Mirroring for WordPress Plugin Development
@javorszky
javorszky / colortest.sh
Created March 16, 2021 21:36
small sh file to test coloring in terminals, 16 colors
#!/bin/sh
echo "\033[30m Black"
echo "AAAAAAAAAAA"
echo ""
echo "\033[31m Red"
echo "AAAAAAAAAAA"
echo ""
echo "\033[32m Green"
echo "AAAAAAAAAAA"
@javorszky
javorszky / gist:7098185
Last active December 26, 2015 05:08 — forked from halfdan/gist:7098180
.designs/
wp-content/*
!wp-content/themes
wp-content/themes/**/node_modules
wp-content/themes/**/.sass-cache
<?php
/**
* This function is responsible to add multiple fields into the input.
* Without this the subfields won't even get mentioned in the form.
* Also, this is only true if the form does not have a field of this
* type yet. If it does, and you change this, the changes will NOT
* show up in the form.
*
* For reference, go to /plugins/gravityforms/js.php

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@javorszky
javorszky / IEconsole.js
Created June 13, 2013 09:35
how to stop IE from bitching about missing console
/**
* Making sure that console.log will not kill
*/
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
@javorszky
javorszky / strpos.php
Created June 10, 2013 15:33
Why I hate PHP part n
<?php
$var[] = "Email";
$var[] = "Notmail";
foreach($var as $v) {
if(strpos($v, "Email")){
echo "Yes, this is email";
} else {
echo "Not email";
@javorszky
javorszky / 960-border-box.sass
Created June 5, 2013 10:26
960.gs is an awesome starter grid. Sadly it's content box... so I've made it play nice with border-box
$width: 960px
$cols: 12
$gutter: 16px
@mixin clearfix-micro()
&
*zoom: 1
&:before,
&:after
{
"id": 4,
"name": "Bob",
"email": "bob@fromaccounting.com",
"meta": {
"plugins": [
"foo": {
"setting1": "value1",
"etc": "etc"
},
@javorszky
javorszky / client_meteor.js
Created May 27, 2013 09:12
What my meteor does
// The client side:
Template.resend_verification.rendered = function(){
console.log('this is the rendered function');
userId=Session.get('selectedUserId');
var user = Meteor.user(),
emails = user.emails,
verified = false,
sent = false;