Skip to content

Instantly share code, notes, and snippets.

View Trion129's full-sized avatar

Parminder Singh Trion129

View GitHub Profile
@Trion129
Trion129 / foobar.js
Last active December 27, 2020 12:09
Google Foobar Invite Generate
// Generate Google foobar invite, go to any website, open console and paste and run the following
// NOTE: Disable popup blocker.
// On one of the tabs you'll see the foobar invite generated.
for(var i = 0; i < 10; i++){
window.open("https://google.com/search?q=arraylist+java");
}
@Trion129
Trion129 / index.html
Created July 3, 2019 18:59
Steering behaviour - from coding train, but generation-wise growth
<html>
<head>
<meta charset="UTF-8">
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.min.js"></script>
<script language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/addons/p5.dom.min.js"></script>
<script language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/addons/p5.sound.min.js"></script>
<script language="javascript" type="text/javascript" src="vehicle.js"></script>
<script language="javascript" type="text/javascript" src="population.js"></script>
<script language="javascript" type="text/javascript" src="sketch.js"></script>
</head>
@Trion129
Trion129 / agent.cpp
Last active June 20, 2019 10:50
Evolution strategy agent plays space invaders
#include <iostream>
#include <vector>
#include <string>
#include <mlpack/core.hpp>
#include <mlpack/core/optimizers/sgd/sgd.hpp>
#include "../environment.hpp"
using namespace mlpack;
using namespace std;
using namespace arma;
@Trion129
Trion129 / timekiller.js
Created July 13, 2018 14:49
Kills all timers in a website, doesn't kill already killed timeouts for micro optimisation for nerds :P
// Break Timers on websites with ease.
function timerKiller(){
var lastCleanedBorder = 0;
return function () {
var id = window.setTimeout(function() {}, 0);
for(var i = lastCleanedBorder; i <= id; i++) {
window.clearTimeout(i);
}
lastCleanedBorder = id + 1;
@Trion129
Trion129 / .vimrc
Created February 1, 2018 09:10
My vimrc
set number
set linebreak
set showbreak=+++
set textwidth=100
set showmatch
set visualbell
set hlsearch
set smartcase
set ignorecase
@Trion129
Trion129 / DogBreedTransferLearning.ipynb
Created November 13, 2017 05:57
Me trying to learn Transfer Learning using Inception :-)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Trion129
Trion129 / NaiveAgent.hpp
Last active March 28, 2017 19:41
Agents
#include <cmath>
#include <mlpack/core.hpp>
#include <mlpack/core/optimizers/sgd/sgd.hpp>
#include <mlpack/methods/ann/layer/layer.hpp>
#include <mlpack/methods/ann/ffn.hpp>
#include <mlpack/methods/ann/layer/linear.hpp>
#include <mlpack/methods/ann/layer/dropout.hpp>
#include <mlpack/methods/ann/layer/leaky_relu.hpp>
#include <mlpack/methods/ann/layer/convolution.hpp>
@Trion129
Trion129 / sgd.py
Created January 9, 2017 14:49
Stochastic Gradient Descent and 2 layer neural network
batch_size = 128
valid_dataset = valid_dataset[:batch_size]
valid_labels = valid_labels[:batch_size]
test_dataset = test_dataset[:batch_size]
test_labels = test_labels[:batch_size]
graph = tf.Graph()
with graph.as_default():
# Input data. For the training data, we use a placeholder that will be fed