Skip to content

Instantly share code, notes, and snippets.

@vs4vijay
vs4vijay / GetDataFromXPath
Created Sep 27, 2013
Extract Data from XPath via Google Apps Script
View GetDataFromXPath
function getDataFromXpath(path, url) {
var data = UrlFetchApp.fetch(url);
var text = data.getContentText();
var xmlDoc = Xml.parse(text, true);
// Replacing tbody tag because app script doesnt understand.
path = path.replace("/html/","").replace("/tbody","","g");
var tags = path.split("/");
Logger.log("tags : " + tags);
// getting the DOM of HTML
View viz-metadata.json
{
"name": "Viz Pool",
"description": "A Cardano Pool on Testnet",
"ticker": "VIZ",
"homepage": "https://github.com/vs4vijay"
}
@vs4vijay
vs4vijay / sms_rules.json
Created Apr 18, 2017
Jio SMS Rules JSON
View sms_rules.json
{
"blacklist_regex": "(?i).*[^a-z](password|otp|verification|activation|passcode)[^a-z].*",
"min_app_version": "131",
"rules": [
{
"name": "Airtel",
"telco": true,
"patterns": [
{
"regex": "(?i)Bill.*\\sfor\\sRs.\\s?([\\d,\\,]*(?:.\\d{2})?).*mobile\\s?(\\d{10})?.*Due\\sDate:\\s?([\\d,\\-,A-Z]*)",
View gist:bf4d49dce1321b023a07e9c1f807389e
### Keybase proof
I hereby claim:
* I am vs4vijay on github.
* I am vs4vijay (https://keybase.io/vs4vijay) on keybase.
* I have a public key ASBV_u_0IvkkCaNqzD09urK2ioS-zpwABimqh0UmjFurpgo
To claim this, I am signing this object:
@vs4vijay
vs4vijay / latency.txt
Created Nov 17, 2016 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
View app.yaml
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
View gist:7098590
$scope.saveStudent = function(index, row){
window.ss = $scope.selectedStudent;
window.rr = row;
console.log("$scope.studentGridData[row.rowIndex] " + row);
console.log($scope.studentGridData[row.rowIndex]);
console.log("$scope.selectedStudentselectedStudent : row.rowIndex " + row.rowIndex);
console.log($scope.selectedStudent);
Consolidate.createConsolidationStageStudent($scope.milestoneId, ss[0].StudentName, function(data) {
View robot.js
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
View robot.js
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
View Viz
First Gist