Skip to content

Instantly share code, notes, and snippets.

Blaine Lafreniere brlafreniere

Block or report user

Report or block brlafreniere

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
View gist:3382b85fb20d1cf40d02d5ff2d440175
Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:6:5-20:19 to override.
View mystery_function.php
add_action( 'pre_get_posts', function( $q )
{
if( $title = $q->get( '_meta_or_title' ) )
{
add_filter( 'get_meta_sql', function( $sql ) use ( $title )
{
global $wpdb;
// Only run once:
static $nr = 0;
View gist:b01e70d4c6807b635a7482b14ea3df14
Array
(
[relation] => AND
[0] => Array
(
[key] => active
[value] => 1
[type] => NUMERIC
)
View gist:fc5dc757c39b6bdd0bfb295f0c41f7d4
(for [zipper (iterate zip/right zipper-start)
:let [node (zip/node zipper)]
:while (or (not= (get node :tag) :h2) (not (zip/end? zipper)))]
node))
View gist:880555e6643ae7daa4016ab51318876f
{:profiles
{:user
{:plugins [[mvxcvi/whidbey "1.3.2"]]
:dependencies [[]]}}}
View crypto.js
function getCurrentPrice(currency) {
var response = UrlFetchApp.fetch("https://api.gdax.com/products/" + currency + "-USD/ticker");
var response_json = JSON.parse(response);
return response_json.price;
}
function update_prices() {
SpreadsheetApp.getActiveSheet().getRange('B2').setValue(getCurrentPrice('BTC'));
SpreadsheetApp.getActiveSheet().getRange('B3').setValue(getCurrentPrice('LTC'));
SpreadsheetApp.getActiveSheet().getRange('B4').setValue(getCurrentPrice('ETH'));
View conflict.js
<script>
$ = jQuery;
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
<script>
jQuery.noConflict(true); // this will unset $
</script>
View gist:01af6b8a30d80f3943257d64be5b6710
function reload_post_grid_items(url) {
if (!url) {
var url = window.location.pathname + '?' + jQuery('#bwp-post-grid-form').serialize();
}
jQuery('#bwp-post-grid-items > *').fadeOut('slow');
jQuery('#bwp-post-grid-items').load(url + ' ' + '#bwp-post-grid-items > *', function () {
register_event_handlers();
jQuery('#bwp-post-grid-items > *').fadeIn('slow');
});
View gist:651c226f488339a4b476472be4d614bc
from pprint import pprint
DUPES_FILE = './dupes.txt'
def process_dupes(dupes_file):
groups = [[]]
index = 0
for line in dupes_file:
if line != '\n':
path = line.split(' ')[1]
groups[index].append(path)
You can’t perform that action at this time.