Skip to content

Instantly share code, notes, and snippets.

View dhilipsiva's full-sized avatar
🏠
Working from home

dhilipsiva dhilipsiva

🏠
Working from home
View GitHub Profile
@dhilipsiva
dhilipsiva / Dockerfile
Created July 25, 2020 06:22
Multistage build dockerfile
# Stage 1: Build a React Docker Image
FROM node as build
WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY . /app
RUN npm run build
# Stage 2, use the compiled app, ready for production with Nginx
FROM nginx
@dhilipsiva
dhilipsiva / flatten.py
Created October 9, 2017 16:57
Flatten
def flatten(items):
new_items = []
for item in items:
if type(item) == int:
new_items.append(item)
else:
new_items += flatten(item)
return new_items
print(flatten([[1,2,[3]],4]))
@dhilipsiva
dhilipsiva / dhilipsiva.id.txt
Created July 31, 2017 02:17
Verifying that "dhilipsiva.id" is my Blockstack ID. https://onename.com/dhilipsiva
Verifying that "dhilipsiva.id" is my Blockstack ID. https://onename.com/dhilipsiva
@dhilipsiva
dhilipsiva / clockin.js
Last active July 19, 2017 05:52
SumHR Login Click-In script. Using PhantomJS.
// INSTRUCTIONS:
// 1. Update "USERNAME", "PASSWORD" and "COMPANY"
// 2. In terminal, run `pjantomjs clockin.js`
// 3. Have a coffee and start coding away :)
// You can also run this as a CRON script everyday!
var USERNAME="USERNAME",
PASSWORD="PASSWORD",
COMPANY="COMPANY",
sys = require("system"),
page = require("webpage").create(),
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# vim: fenc=utf-8
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
#
"""
File name: spreadsheet.py
@dhilipsiva
dhilipsiva / foodie-sheet.js
Created May 30, 2016 04:28
This is Google Sheet custom scripts to get total stats.
/*
This is Google Sheet custom scripts to get total stats.
*/
function BFCOUNT(range) {
var ss = SpreadsheetApp.getActive();
var numRows = range.length;
var items = {};
for (var key in range) {
if (range.hasOwnProperty(key)) {
item = range[key];
@dhilipsiva
dhilipsiva / gcloud-deis-setup.sh
Last active August 5, 2020 16:56
A script to provision GCE for setting up Deis
#! /bin/bash
#
# create_instances.sh
# Copyright (C) 2016 dhilipsiva <[email protected]>
#
# Distributed under terms of the MIT license.
#
INSTANCES=3
PREFIX_APP="deisdemo-"
@dhilipsiva
dhilipsiva / chrconverter.js
Last active November 8, 2015 04:13
XSS - A cross-site script
var chr, codes, i, len, str;
str = "text";
codes = [];
for (i = 0, len = str.length; i < len; i++) {
chr = str[i];
codes.push(chr.charCodeAt(0));
}
console.log(codes);
@dhilipsiva
dhilipsiva / BadooSpam.coffee
Created August 29, 2015 19:39
Badoo Spam script
###
Badoo spam and like users.
Restrictions due to messages limit per day and captchas still cannot be bypassed. :P
###
getPage = (url) ->
$.get url
.done (response, success, xhr) ->
results = $ response
for result in results.find ".user-card"
d1 = $ result
@dhilipsiva
dhilipsiva / SpamTwooUsers.coffee
Last active August 9, 2022 03:29
Spam Twoo Users
getPage = (url) ->
$.get url
.done (response, success, xhr) ->
results = $ JSON.parse(response).html
for result in results.find ".card--gridFlex"
d1 = $ result
profile_id = d1.find(".jsCard").attr "id"
continue if !profile_id
profile_id = profile_id.replace "profile_", ""
data =