Skip to content

Instantly share code, notes, and snippets.

@kp666
kp666 / inflation.js
Last active February 25, 2021 01:34
View inflation.js
// Compound interest
// Compound interest increases as a certain percentage
// of the principal each year. This gives us the formula
const compoundInterest = ({principal, ratePercentage, time}) => {
return principal * ((1 + ratePercentage/100) ** time);
};
const initialAmount =({finalAmount,ratePercentage, time })=> {
return finalAmount/((1 + ratePercentage/100) ** time);
View 0x_working.rb
require 'ox'
xml = %{
<top name="sample">
<middle name="second">
<bottom name="third">Rock \u266A bottom</bottom>
</middle>
</top>
}
View ox_fail.rb
require 'ox'
xml = %{
<top name="sample">
<middle name="second">
<bottom name="third">Rock \u0003 bottom</bottom>
</middle>
</top>
}
View trackerlist
udp://public.popcorn-tracker.org:6969/announce
http://104.28.1.30:8080/announce
http://104.28.16.69/announce
http://107.150.14.110:6969/announce
http://109.121.134.121:1337/announce
View trackerlist
udp://public.popcorn-tracker.org:6969/announce
http://104.28.1.30:8080/announce
http://104.28.16.69/announce
http://107.150.14.110:6969/announce
http://109.121.134.121:1337/announce
@kp666
kp666 / sample.js
Created December 27, 2019 17:09
sample.js
View sample.js
app.post('/login', function (req, res, next) {
passport.use(new GoogleStrategy({
clientID: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET,
callbackURL: "http://localhost:3000/auth/google/dashboard",
userProfileURL: "https://www.googleapis.com/oauth2/v3/userinfo"
},
function(accessToken, refreshToken, profile, cb) {
if(profile._json.hd === "nitc.ac.in"){
User.findOrCreate({ googleId: profile.id ,displayName:profile.displayName,email:profile.emails[0].value}, function (err, user) {
View gist:df8623af7a569aef4f0146a4d210e029
app.post('/login', function (req, res, next) {
passport.use(new GoogleStrategy({
clientID: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET,
callbackURL: "http://localhost:3000/auth/google/dashboard",
userProfileURL: "https://www.googleapis.com/oauth2/v3/userinfo"
},
function(accessToken, refreshToken, profile, cb) {
if(profile._json.hd === "nitc.ac.in"){
User.findOrCreate({ googleId: profile.id ,displayName:profile.displayName,email:profile.emails[0].value}, function (err, user) {
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@kp666
kp666 / gosugol.rb
Last active February 28, 2019 14:28
View gosugol.rb
require 'gosu'
class Tutorial < Gosu::Window
def initialize(board_width, board_height, pattern_file)
@board_width = board_width
@board_height = board_height
@columns = board_width / 12
@rows = board_height / 12
super @board_width, @board_height, update_interval: 100
@kp666
kp666 / Test.csv
Created October 22, 2018 13:01
Test
View Test.csv
Paris 1 2