Skip to content

Instantly share code, notes, and snippets.

View ashishdoneriya's full-sized avatar

Ashish Doneriya ashishdoneriya

View GitHub Profile
package main
import (
"log"
"net/http"
"os"
)
func main() {
fs := http.FileServer(http.Dir("./"))
package main
import (
"bufio"
"encoding/csv"
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
<?php
if (isset($_GET['download'])) {
$file = $_GET['download'];
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.basename($file).'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
@ashishdoneriya
ashishdoneriya / two-way-binding.js
Created January 22, 2018 11:21 — forked from straker/two-way-binding.js
Simple and small two-way data binding between DOM and data
/**
* @param {object} scope - Object that all bound data will be attached to.
*/
function twoWayBind(scope) {
// a list of all bindings used in the DOM
// @example
// { 'person.name': [<input type="text" data-bind="person.name"/>] }
var bindings = {};
// each bindings old value to be compared for changes
@ashishdoneriya
ashishdoneriya / webshell.php
Created July 28, 2017 13:02 — forked from taeguk/webshell.php
Simple PHP Webshell
<!-- Project Name : PHP Web Shell -->
<!-- Version : 0.01 -->
<!-- First development date : 2012/07/31 -->
<!-- This Version development date : 2012/07/31 -->
<!-- language : html, css, javascript, php -->
<!-- Developer : majorPE -->
<!-- Web site : http://blog.naver.com/xornrbboy -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /index.html [NC,L]
@ashishdoneriya
ashishdoneriya / key-value.pipe.ts
Created December 15, 2016 15:35 — forked from bombadillo/key-value.pipe.ts
Angular 2 Key Value Pipe
import { Pipe, PipeTransform } from '@angular/core';
/*
* Enables the key/value pair of an item to be
* visible within an ngFor
* Usage:
* value of iteratable | keyValue
* Example:
* <ul>
* <li *ngFor='key of demo | keyValue'>
@ashishdoneriya
ashishdoneriya / Google Preetify
Last active October 6, 2016 09:23
Google Preetify
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
/************************** Goole ****************************/
/* desert scheme ported from vim to google prettify */
pre.prettyprint { display: block; background-color: #333 }
pre .nocode { background-color: none; color: #000 }
pre .str { color: #ffa0a0 } /* string - pink */
pre .kwd { color: #f0e68c}
pre .com { color: #87ceeb } /* comment - skyblue */
pre .typ { color: #98fb98 } /* type - lightgreen */
pre .lit { color: #cd5c5c } /* literal - darkred */
org.apache.ant_1.9.6.v201510161327
org.junit_4.12.0.v201504281640
org.eclipse.ant.core.source_3.4.100.v20160505-0642.jar
org.eclipse.ant.core_3.4.100.v20160505-0642.jar
org.eclipse.ant.launching.source_1.1.200.v20160418-1631.jar
org.eclipse.ant.launching_1.1.200.v20160418-1631.jar
org.eclipse.ant.ui.source_3.6.200.v20160525-1820.jar
org.eclipse.ant.ui_3.6.200.v20160525-1820.jar
org.eclipse.pde.junit.runtime.source_3.5.0.v20151013-0625.jar
org.eclipse.pde.junit.runtime_3.5.0.v20151013-0625.jar