Skip to content

Instantly share code, notes, and snippets.

View samarpanda's full-sized avatar
👋

Samar Panda samarpanda

👋
View GitHub Profile
/**
* Add dataset support to elements
* No globals, no overriding prototype with non-standard methods,
* handles CamelCase properly, attempts to use standard
* Object.defineProperty() (and Function bind()) methods,
* falls back to native implementation when existing
* Inspired by http://code.eligrey.com/html5/dataset/
* (via https://github.com/adalgiso/html5-dataset/blob/master/html5-dataset.js )
* Depends on Function.bind and Object.defineProperty/Object.getOwnPropertyDescriptor (shims below)
* Licensed under the X11/MIT License
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [ {name: "Run Query", functionName: "runQuery"} ];
ss.addMenu("HTTP Archive + BigQuery", menuEntries);
}
function runQuery() {
var projectNumber = 'httparchive';
var sheet = SpreadsheetApp.getActiveSheet();
@samarpanda
samarpanda / Git_Help_doc.md
Last active June 3, 2020 06:35
Git Command help docs for Komli

Komli Git Help Docs

Clone any of the komli repositories. cd into the directory before running any of the below commands.

Pullrequests

It is great if you could create a pullrequest for every changes your want to merge to master. This way we have can have a complete diff(single view) of codebase which was merged to master with the context. Easier to back track releases and the reason why we did some changes. We will plan to make it mandatory soon.

Cherry-pick commits between branches

## Pick and commit and hash and go the branch where you want to move this commit to and run the below command
@samarpanda
samarpanda / Access_Session_Data.md
Created January 16, 2015 18:43
Accessing CodeIgniter Session Data

Accessing CodeIgniter Session Data

require_once("config.php");
$cisess_cookie = $_COOKIE['ci_session'];
$cisess_cookie = stripslashes($cisess_cookie);
$cisess_cookie = unserialize($cisess_cookie);
$cisess_session_id = $cisess_cookie['session_id'];
@samarpanda
samarpanda / README.md
Last active August 29, 2015 14:13
Learn using Composer & PHP
@samarpanda
samarpanda / is_function_native_to_browser.js
Created February 7, 2015 19:04
Detect if function is native to browser
var numf=0; var nump=0; var numo=0;
for(var p in this) {
if(typeof(this[p]) === "function"){
if(this[p].toString().indexOf('[native code]') === -1){
numf+=1;
console.log(p+"()");
}
} else if(typeof p != 'undefined'){
nump+=1;
console.log(p);
@samarpanda
samarpanda / update_htaccess.md
Last active August 29, 2015 14:16
Update htaccess to redirect www.domain.com to domain.com

Required htaccess changes for http and https

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
@samarpanda
samarpanda / index.html
Last active August 29, 2015 14:17 — forked from anonymous/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
function curry(fn){
@samarpanda
samarpanda / git_help.md
Last active August 29, 2015 14:17
git subtree for github page deployment

Using git subtree to push gh-pages branch or deploy project pages.

  1. Remove _site or build folder from .gitignore file.
  2. Add build directory to git traking folder or commits changes to build directory.
  3. Push changes to github gh-pages branch
# replace build_folder as appropriate  
git subtree push --prefix build_folder origin gh-pages
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.8.0/ramda.min.js"></script>
</head>
<body>
<script id="jsbin-javascript">
var _ = R;