Skip to content

Instantly share code, notes, and snippets.

View nmoinvaz's full-sized avatar

Nathan Moinvaziri nmoinvaz

  • Phoenix, United States
View GitHub Profile
/* benchmark_adler32.cc -- benchmark adler32 variants
* Copyright (C) 2020 Nathan Moinvaziri
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include <stdint.h>
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
@KungFuJesus
KungFuJesus / adler32_benchmark.cc
Created January 11, 2022 20:14
better benchmark
#include <stdint.h>
#include <stdio.h>
#include <stdint.h>
#include <benchmark/benchmark.h>
#include "zbuild.h"
#include "zutil.h"
extern "C" void cpu_check_features();

transpile es6 into es5 using babel cli.

first install required packages globally.

npm install -g @babel/core @babel/node @babel/preset-env @babel/cli

then use command below to perform transpilation.

//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@scottgulliver
scottgulliver / checkout_branches.ps1
Created January 31, 2018 12:03
Powershell script to checkout all remote git branches
git branch -r | Select-String -Pattern "->" -NotMatch | Select-String -pattern "^ origin/" | foreach { $_ -replace '^ origin/', '' } | Foreach { git checkout $_ }
add_filter('upload_dir', 'cdn_upload_url');
function cdn_upload_url($args)
{
if (!is_admin()) {
$args['baseurl'] = 'https://your-awesome-cdn.net/wp-content/uploads';
}
return $args;
}
@bdeleasa
bdeleasa / wp-domain-masking.php
Created April 14, 2016 15:19
Wordpress plugin that removes the X-Frame-Options header to allow for domain masking.
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link http://example.com
@ralphbean
ralphbean / flickr-scraper.py
Last active January 15, 2022 23:43
Script to scrape images from a flickr account.
#!/usr/bin/env python
""" Script to scrape images from a flickr account.
Author: Ralph Bean <rbean@redhat.com>
"""
import ConfigParser
import urllib
import requests
@bentsai
bentsai / gist:3150936
Created July 20, 2012 14:11
The jQuery.extend function
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;