Skip to content

Instantly share code, notes, and snippets.

View randyburden's full-sized avatar

Randy Burden randyburden

View GitHub Profile
@adhipg
adhipg / countries.sql
Created January 12, 2012 11:41
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@cowboy
cowboy / HEY-YOU.md
Last active April 9, 2024 15:54
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@oneillci
oneillci / gist:3205384
Created July 30, 2012 06:45
Using EF Include() with generic repository
public IQueryable<T> FindBy(Expression<Func<T, bool>> predicate, params Expression<Func<T, object>>[] includes)
{
var query = GetAll().Where(predicate);
return includes.Aggregate(query, (current, includeProperty) => current.Include(includeProperty));
}
// Sample usage
userRepository.FindBy(x => x.Username == username, x.Roles)
@dalexsoto
dalexsoto / HttpClientProgressExtensions.cs
Last active April 3, 2024 15:01
Add Progress reporting to capabilities to HttpClient
using System;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace HttpClientProgress {
public static class HttpClientProgressExtensions {
public static async Task DownloadDataAsync (this HttpClient client, string requestUrl, Stream destination, IProgress<float> progress = null, CancellationToken cancellationToken = default (CancellationToken))
{
@mattjohnsonpint
mattjohnsonpint / LICENSE
Last active April 2, 2024 02:54
Unified global Unhandled Exception event for .NET MAUI
MIT License
Copyright (c) 2022 Matt Johnson-Pint
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@ramonsmits
ramonsmits / gist:7563502
Created November 20, 2013 13:52
Example of Mandrill webhook JSON data.
[
{
"event": "send",
"msg": {
"ts": 1365109999,
"subject": "This an example webhook message",
"email": "example.webhook@mandrillapp.com",
"sender": "example.sender@mandrillapp.com",
"tags": [
"webhook-example"
@theorigin
theorigin / SQLServer-APIPost.sql
Last active January 9, 2024 12:10
SQL Server code to POST to an API
DECLARE @Object AS INT;
DECLARE @ResponseText AS VARCHAR(8000);
DECLARE @Body AS VARCHAR(8000) =
'{
"what": 1,
"ever": "you",
"need": "to send as the body"
}'
EXEC sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;
@jylopez
jylopez / stripe_country_codes.js
Last active December 24, 2023 23:27
Stripe Country Codes
[
{ country: 'Australia', code: 'AU' },
{ country: 'Austria', code: 'AT' },
{ country: 'Belgium', code: 'BE' },
{ country: 'Brazil', code: 'BR' },
{ country: 'Bulgaria', code: 'BG' },
{ country: 'Canada', code: 'CA' },
{ country: 'Croatia', code: 'HR' },
{ country: 'Cyprus', code: 'CY' },
{ country: 'Czech Republic', code: 'CZ' },
@marciomazza
marciomazza / highlight_sel_element.py
Created July 10, 2012 22:10
Highlights a Selenium Webdriver element
def highlight(element):
"""Highlights (blinks) a Webdriver element.
In pure javascript, as suggested by https://github.com/alp82.
"""
driver = element._parent
driver.execute_script("""
element = arguments[0];
original_style = element.getAttribute('style');
element.setAttribute('style', original_style + "; background: yellow; border: 2px solid red;");
setTimeout(function(){