Skip to content

Instantly share code, notes, and snippets.

View barhoring's full-sized avatar
💭
foo is boring I am Bar Horing

Bar Horing Amir barhoring

💭
foo is boring I am Bar Horing
View GitHub Profile
@barhoring
barhoring / bootstrap.tsx
Created December 24, 2023 12:24
Proxy on push state
const originalPushState = window.history.pushState;
window.history.pushState = function () {
// Your custom logic here before calling the original pushState
// Call the original pushState method
// @ts-ignore
return originalPushState.apply(window.history, arguments);
};
@barhoring
barhoring / index.html
Created April 8, 2022 10:03
simple html + css to start coding
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="../assets/style.css" />
<title>Starter Files and Tooling Setup!</title>
</head>
<style>
@barhoring
barhoring / gitpen.sh
Created December 3, 2021 14:19
codepen to git
# run like:
# LINK=https://codepen-api-export-production.s3.us-west-2.amazonaws.com/zip/PEN/*********/*****************/2a-end-flexbox-grid-system.zip
# sh gitpen.sh $LINK
# example
# sh gitpen.sh https://codepen-api-export-production.s3.us-west-2.amazonaws.com/zip/PEN/*********/*****************/2a-end-flexbox-grid-system.zip
#
MYVAR=$1
NAME="${MYVAR#http://}"
@barhoring
barhoring / index.js
Created October 2, 2021 18:28 — forked from zkat/index.js
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@barhoring
barhoring / SetFileList.html
Created June 16, 2021 05:19 — forked from guest271314/SetFileList.html
Set the FileList of <input type="file"> to arbitrary File objects
<!DOCTYPE html>
<!-- guest271314 11-12-2017 -->
<!-- see https://stackoverflow.com/questions/47119426 -->
<html>
<head>
</head>
<body>
<script>
@barhoring
barhoring / guide.md
Created June 8, 2021 17:05
How to deploy a routed React app to gh-pages

How to deploy a routed React app to gh-pages

Add homepage to package.json "homepage": "https://{user_name}.github.io/{repo_name}/",

Install gh-pages package

npm i gh-pages

Replace all '/' in the app with process.env.PUBLIC_URL

@barhoring
barhoring / .babelrc
Created June 7, 2021 09:45
ESLint + Prettier + Babel configuration
{
"plugins": ["syntax-dynamic-import"]
}
@barhoring
barhoring / main.js
Created December 20, 2020 11:55
create promise array and use axios to wait for all to return
{/*
LIVE EXAMPLE:
https://repl.it/@BarHoring/multiple-http#index.js
*/}
const axios = require('axios');
const fs = require('fs');
const dependencies = [
"@babel/polyfill",
"@blueprintjs/select",
@barhoring
barhoring / qs.py
Created November 24, 2020 13:24
Django - Iterate over queryset
qs = Clinic.objects.prefetch_related('users')
values = tmp.values()
for item in values:
print(item)