Skip to content

Instantly share code, notes, and snippets.

View hiramhuang's full-sized avatar
🤩
working on new project

Hiram hiramhuang

🤩
working on new project
View GitHub Profile
@goldo
goldo / lodash-assignIn-merge-defaults-diff.js
Last active December 14, 2023 00:49
Differences between .assignIn(), .assign, .merge(), defaults() and defaultsDeep()
// Tests with Lodash 4.16.4
// Thanks to http://stackoverflow.com/questions/19965844/lodash-difference-between-extend-assign-and-merge
_.assignIn ({}, { a: 'a' }, { a: 'bb' }) // => { a: 'bb' }
_.merge ({}, { a: 'a' }, { a: 'bb' }) // => { a: 'bb' }
_.defaults ({}, { a: 'a' }, { a: 'bb' }) // => { a: 'a' }
_.defaultsDeep({}, { a: 'a' }, { a: 'bb' }) // => { a: 'a' }
---
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@paulodeleo
paulodeleo / .tmux.conf
Last active July 15, 2022 10:16
Tmux configuration to enable mouse scroll and mouse panel select, taken from: http://brainscraps.wikia.com/wiki/Extreme_Multitasking_with_tmux_and_PuTTY
# Make mouse useful in copy mode
setw -g mode-mouse on
# Allow mouse to select which pane to use
set -g mouse-select-pane on
# Allow mouse dragging to resize panes
set -g mouse-resize-pane on
# Allow mouse to select windows
@willmot
willmot / disable-updates.php
Created May 29, 2012 21:08
Disable core, theme and plugin update checks and notices and remove the update page from nav
<?php
// Don't disable on dev
if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) {
// Disable core update checking
add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );
remove_action( 'admin_init', '_maybe_update_core' );
remove_action( 'wp_version_check', 'wp_version_check' );
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

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