Skip to content

Instantly share code, notes, and snippets.

@tariqhamid
tariqhamid / webpack.config.js
Created February 1, 2017 12:59 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@tariqhamid
tariqhamid / openssl-build.sh
Created December 22, 2016 16:23 — forked from Norod/openssl-build.sh
A shell script to build openssl for iOS and Mac. >>>>> It currently builds: Mac (i386, x86_64) >>>>> iOS (armv7, arm64) >>>>> iOS Simulator (i386, x86_64) >>>>> Updated to work with Xcode 7 and produce bitcode enabled binaries >>>>> Minimum deployment target can be easily configured
#!/bin/bash
# This script builds the iOS and Mac openSSL libraries with Bitcode enabled
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# Peter Steinberger, PSPDFKit GmbH, @steipete.
# Doron Adler, GlideTalk, @Norod78
@tariqhamid
tariqhamid / openssl-maker.sh
Created December 22, 2016 16:23 — forked from letiemble/openssl-maker.sh
A bash script to generate "all-in-one" OpenSSL static libraries for OS X and iOS. The script produces fat static libraries (i386, x86_64 for OS X) and (i386, x86_64, armv7, armv7s, arm64 for iOS) suitable for integration in both OS X and iOS project.
#!/bin/bash
###############################################################################
## ##
## Build and package OpenSSL static libraries for OSX/iOS ##
## ##
## This script is in the public domain. ##
## Creator : Laurent Etiemble ##
## ##
###############################################################################
@tariqhamid
tariqhamid / openssl-build.sh
Created December 22, 2016 16:21 — forked from felix-schwarz/openssl-build.sh
Updated script that builds OpenSSL for OS X, iOS and tvOS. Bitcode enabled for iOS, tvOS. Updated to build for tvOS, use the latest SDKs, skip installing man pages (to save time), download the OpenSSL source over HTTPS, patch OpenSSL for tvOS to not use fork(). Currently requires Xcode7.1b or later (for the tvOS SDK).
#!/bin/bash
# This script downloads and builds the iOS, tvOS and Mac openSSL libraries with Bitcode enabled
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# https://gist.github.com/foozmeat/5154962
# Peter Steinberger, PSPDFKit GmbH, @steipete.
# Felix Schwarz, IOSPIRIT GmbH, @felix_schwarz.
@tariqhamid
tariqhamid / couchdb-bulk.json
Created November 19, 2016 19:34 — forked from anchetaWern/couchdb-bulk.json
couchdb bulk json
{
"docs": [
{
"name": "Squirtle",
"type": ["Water"],
"trainer": "Ash",
"gender": "m",
"owned": "1999-05-21"
},
{
@tariqhamid
tariqhamid / gist:7b1261b4c0c10af5e30a467642f6cf62
Created November 10, 2016 01:45 — forked from bgrins/gist:1789787
C# Multipart File Upload
// Implements multipart/form-data POST in C# http://www.ietf.org/rfc/rfc2388.txt
// http://www.briangrinstead.com/blog/multipart-form-post-in-c
public static class FormUpload
{
private static readonly Encoding encoding = Encoding.UTF8;
public static HttpWebResponse MultipartFormDataPost(string postUrl, string userAgent, Dictionary<string, object> postParameters)
{
string formDataBoundary = String.Format("----------{0:N}", Guid.NewGuid());
string contentType = "multipart/form-data; boundary=" + formDataBoundary;
@tariqhamid
tariqhamid / CouchDb quickstart example
Created October 31, 2016 01:11 — forked from davidwhitney/CouchDb quickstart example
CouchDb quickstart example
using System;
using System.Web.Mvc;
using Divan;
using Newtonsoft.Json;
namespace CouchTest.Controllers
{
[HandleError]
public class HomeController : Controller
{
@tariqhamid
tariqhamid / WorldCup Monte Carlo Simulations.js
Last active September 3, 2016 00:10 — forked from greenido/WorldCup Monte Carlo Simulations.js
WorldCup Monte Carlo Simulations in Apps Script (For a post)
/***************************************************************************
* This is a Monte Carlo simulation
* to see who will win the 2014 World Cup
* Data ideas: http://fivethirtyeight.com/interactives/world-cup/
* See: http://goo.gl/NV2OLc for a diagram of the odds.
* Author: Ido Green | @greenido | plus.google.com/+greenido
* Date: 4th July 2014
* *************************************************************************/
// Decide base on our odds who will win each match
@tariqhamid
tariqhamid / YT_Dashboard_Stats_For_post.js
Created September 2, 2016 23:37 — forked from greenido/YT_Dashboard_Stats_For_post.js
YouTube Dashboard Stats with Google Apps Script
/**
* YouTube Dashboard Stats Example
* Fetch stats on videos and channel by using YT APIs.
* 1. It using the ATOM feeds - v1.
* 2. For the channel we are using the v3 version of the API.
*
* @Author: Ido Green | @greenido | +Greenido
* @Date: Aug 2014
*
* @see:
@tariqhamid
tariqhamid / YT-Analytics-api-example.js
Created September 2, 2016 22:46 — forked from greenido/YT-Analytics-api-example.js
YouTube Analytics API Apps Script Example
/**
* YouTube Analytics API Example
* Fetch views and 'estimated view time' on videos you have in your channel.
*
* @Author: Ido Green
* @Date: Aug 2014
*
*/
function getVideoEstimatedMinutesWatched(videoId) {
var myChannels = YouTube.Channels.list('id', {mine: true});