Skip to content

Instantly share code, notes, and snippets.

@perryraskin
perryraskin / createPrismaMigration.ts
Last active August 2, 2024 20:18
Prisma Migrations Automated Git Pipeline
const { execSync } = require("child_process")
const readline = require("readline")
// Get the current branch name
const branchName = execSync(`git rev-parse --abbrev-ref HEAD`).toString().trim()
const migrationName = `${branchName}`
// Create readline interface
const rl = readline.createInterface({
input: process.stdin,
@perryraskin
perryraskin / coverdash-demo.tsx
Last active November 7, 2022 04:11
Coverdash Demo
function App() {
return <CoverdashQuotes license="xxxxxxx-xxxx-xxxx-xxxx-xxxxxxx" />
}
@perryraskin
perryraskin / cloudwatch-get-logs.js
Created February 2, 2022 14:04
Get live logs from AWS CloudWatch
var AWS = require("aws-sdk");
AWS.config.update({
region: "us-west-2",
});
const {
CloudWatchLogsClient,
AssociateKmsKeyCommand,
StartQueryCommand,
GetQueryResultsCommand,
@perryraskin
perryraskin / generateTrackingUrl.js
Last active May 16, 2022 00:16
A function that generates tracking URLs for popular shipping carriers
function generateTrackingUrl(carrier, trackingNumber) {
switch (carrier) {
case "usps":
return `https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1=${trackingNumber}`
case "ups":
return `https://www.ups.com/track?loc=null&tracknum=${trackingNumber}&requester=WT/trackdetails`
case "fedex":
return `https://www.fedex.com/fedextrack/?trknbr=${trackingNumber}`
case "lasership":
return `https://t.lasership.com/Track/${trackingNumber}`
@perryraskin
perryraskin / html-classes-to-css.js
Last active July 10, 2024 14:01
Extract CSS classes out of HTML code
/*
* Use this script to extract CSS classes out of HTML code.
* Replace the test HTML code on line 8-9 with your HTML code.
* Run `node html-classes-to-css.js` in your terminal and a CSS file will be generated.
*/
const fs = require("fs");
var html =
`<div id="1432" class="test class-test another-class"><p class="bold text-small something"></p></div>`;
@perryraskin
perryraskin / hoobs_checker.js
Last active March 18, 2021 00:43
HOOBS Status Checker
/*
1) Install node-fetch via npm or yarn in the same directory as this file.
2) Create a bot in Telegram via chatting with @BotFather and copy the bot token he provides.
3) Start the chat, then go to https://api.telegram.org/bot<token>/getUpdates in a browser.
4) Send a message to the bot, refresh the webpage, and you should see your chat id in the json response.
5) Fill in BOT_TOKEN and CHAT_ID below.
6) Fill in HOOBS_USERNAME, HOOBS_PASSWORD, and HOOBS_SERVER_URL (e.g. http://192.168.1.100) below.
6) Run this on your HOOBS server and HOOBS will never be down again.
*/
@perryraskin
perryraskin / Details.js
Created September 12, 2019 01:13
Me.js vs Details.js
import React, { Component } from 'react';
import { ScrollView, Button, View, Text } from 'react-native';
import { createStackNavigator, createAppContainer } from 'react-navigation';
import { Header, Actions, Info } from '../components/UserDetails/';
import colors from '../config/colors';
class Details extends Component {
render() {

Keybase proof

I hereby claim:

  • I am perryraskin on github.
  • I am perryraskin (https://keybase.io/perryraskin) on keybase.
  • I have a public key ASBBaYp8UNxQIxI5qQdWelN84F2lsa753rjMWbCoaN-9OQo

To claim this, I am signing this object:

/*
*
* CS 323 Project 1 (C++)
*
* Linked List Class: Insertion Sort
*
* Perry Raskin
* Computer Science, CUNY Queens College
*/
@perryraskin
perryraskin / index.html
Last active September 1, 2017 21:05
cookie css
<!DOCTYPE html>
<html>
<head>
<title>Cookie Store</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<link href="css/styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="container-fluid">