Skip to content

Instantly share code, notes, and snippets.

View hareom284's full-sized avatar
🔍
I do what I love.

Harry hareom284

🔍
I do what I love.
View GitHub Profile
@hareom284
hareom284 / gist:6208518dbb8e25e4bd345c44d494bd3b
Created July 27, 2023 04:40
npm run build to slove command `export NODE_OPTIONS=--openssl-legacy-provider`
$ npm run build
> create-wasm-app@0.1.0 build
> webpack --config webpack.config.js
node:internal/crypto/hash:71
this[kHandle] = new _Hash(algorithm, xofLen);
^
Error: error:0308010C:digital envelope routines::unsupported
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PageBuilder</title>
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9, user-scalable=no">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/grapesjs@0.15.9/dist/css/grapes.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.12/css/bootstrap-select.min.css" integrity="sha256-l3FykDBm9+58ZcJJtzcFvWjBZNJO40HmvebhpHXEhC0=" crossorigin="anonymous">
@hareom284
hareom284 / uninstall.md
Last active June 22, 2023 03:00
Valet uninstall command in mac
valet uninstall
composer global remove laravel/valet
sudo rm /usr/local/bin/valet
@hareom284
hareom284 / policy.php
Last active July 27, 2023 04:42
this function help to check policy in laravel
<?php
if (!function_exists('authorize')) {
/* @throws UnauthorizedUserException */
function authorize($ability, $policy, $arguments = []): bool
{
if ($policy::{$ability}(...$arguments)) {
return false;
}
var plaintext = (window.prompt("plaintext:"));
var key = Number(window.prompt("key:"));
var result="";
for(let p of plaintext)
{
if ( p >= 'a' && p <= 'z')
{
// CHALLENGE 1
function createFunction() {
return function outerFunction()
{
console.log('hello');
}
}
// /*** Uncomment these to check your work! ***/
const function1 = createFunction();
@hareom284
hareom284 / 8.4.py
Created August 10, 2020 17:56
8.4 Open the file romeo.txt and read it line by line. For each line, split the line into a list of words using the split() method. The program should build a list of words. For each word on each line check to see if the word is already in the list and if not append it to the list. When the program completes, sort and print the resulting words in…
fname = input("Enter file name: ")
try:
fh = open(fname)
lst = list()
for line in fh:
lst.append( line.split())
newlist = sum(lst,[])
newlist.sort()
print([newlist[i] for i in range(len(newlist)) if i == newlist.index(newlist[i])])
except :
#include<stdio.h>
#include<cs50.h>
#include<string.h>
#include<math.h>
void Count(string text);
void print(double index);
double Letter = 0.0;
double Sentence = 0.0;
double words =1.0;
int main(void)
@hareom284
hareom284 / cash.c
Created August 4, 2020 16:47
Harvard summer 2020 week 1
#include<stdio.h>
#include<cs50.h>
#include<math.h>
int main(void)
{ float dollars=0;
do
{
dollars = get_float("Chang owned:");
}while(dollars<0);
@hareom284
hareom284 / 7.2.py
Created July 22, 2020 15:27
Write a program that prompts for a file name, then opens that file and reads through the file, looking for lines of the form: X-DSPAM-Confidence: 0.8475 Count these lines and extract the floating point values from each of the lines and compute the average of those values and produce an output as shown below. Do not use the sum() function or a va…
fname = input("Enter file name: ")
fh = open(fname)
count = 0
total = 0.0
for line in fh:
if not line.startswith("X-DSPAM-Confidence:") : continue
count = count + 1
line = line[20:]
line = float(line)
total = total+line