Skip to content

Instantly share code, notes, and snippets.

View SpEcHiDe's full-sized avatar

Shrimadhav U K SpEcHiDe

View GitHub Profile

Keybase proof

I hereby claim:

  • I am spechide on github.
  • I am spechide (https://keybase.io/spechide) on keybase.
  • I have a public key ASCYu5rfydg5X_qaqch6uM0i_lpaKGavqY2HyanL4iULGAo

To claim this, I am signing this object:

@SpEcHiDe
SpEcHiDe / app.js
Created June 5, 2016 07:27
AngularJS : custom routes
var app = angular.module('portfolio', ['ngRoute']);
// create the controller and inject Angular's $scope
app.controller('mainController', function($scope) {
// create a message to display in our view
$scope.message = 'Everyone come and see how good I look!';
});
// configure our routes
app.config(function($routeProvider, $locationProvider) {
@SpEcHiDe
SpEcHiDe / $post.js
Created June 16, 2016 16:34
backing up hardware
var sendData = function(type, URL, formData, callBack){
// create a XHR object
var xhr = new XMLHttpRequest();
// open the XHR object in asynchronous mode
xhr.open(type, URL, true);
//xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=ISO-8859-1')
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
// OK! we have a successful response.
var response = xhr.responseText;
@SpEcHiDe
SpEcHiDe / my.html
Created June 20, 2016 18:07
Code Obfuscator
<!-- textfield to accept input -->
<input type="text" id="f1">
<!-- div to show the output -->
<div id="f2"></div>
<button type="button" onclick="dothis()">Obfuscate</button>
<script>
var dothis = function(){
<link rel="stylesheet" href="css/bootstrap.css" type="text/css">
<?php
$i = 0;
$dirname = "media/images/iconized/";
$images = glob($dirname."*.png");
/*
I do not think that this is a good algorithm, ... :(
*/
foreach($images as $image) {
echo "<div class="row">";
@SpEcHiDe
SpEcHiDe / img2pdf.tex
Last active July 4, 2017 11:08
LaTeX file to convert image to portable document format
\documentclass[12pt,a4paper]{report}
\usepackage[pdftex]{graphicx}
\usepackage[pdfborder={0 0 0}, pdftitle={<pdf title here>}, pdfauthor={<author's name here>}, pdfsubject={<subject here>}, pdfkeywords={<keywords here>}]{hyperref}
\pagenumbering{gobble}
\begin{document}
\includegraphics[scale=0.65,angle=0]{./file_name} % the image file name without extension
\end{document}
@SpEcHiDe
SpEcHiDe / bit.ly.php
Created July 25, 2016 11:16
BULK bit.ly generator
<?php
if(isset($_REQUEST['d'])){
if($_REQUEST['d'] == 1){
ini_set('display_errors', 1);
error_reporting(-1);
}
}
$longurls = array(
"array",
"of long",
#!/bin/bash
## $1 => filename excluding ".partX.rar"
## $2 => directory to download the file to
if [ $# -eq 0 ] ; then
echo "Usage Instructions"
echo "$0 <filename excluding \".partX.rar\"> <directory name>"
else
mkdir $2
@SpEcHiDe
SpEcHiDe / mfree.py
Last active August 16, 2016 16:12
#DGPLUG
#!/usr/bin/env python2
def read_file(filename, numlines) :
'''
reads the first numlines of lines from filename
'''
d = []
with open(filename) as f :
for line in f :
if numlines == 0 :
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
email = SpEcHiDe@users.noreply.github.com
name = Shrimadhav U K
signingkey = 599767107164B031
[credential]