Skip to content

Instantly share code, notes, and snippets.

View yoeven's full-sized avatar
🍁

Yoeven D Khemlani yoeven

🍁
View GitHub Profile
@claus
claus / _app.js
Created May 14, 2020 05:35
Restore scroll position after navigating via browser back/forward buttons in Next.js
import useScrollRestoration from "utils/hooks/useScrollRestoration";
const App = ({ Component, pageProps, router }) => {
useScrollRestoration(router);
return <Component {...pageProps} />;
};
export default App;
@dotproto
dotproto / scratchpad.js
Last active February 17, 2024 15:31
Simple in-browser scratch pad with bookmark-based "saving." To use, copy and paste the this gist into your URL bar. Once loaded, you can save by dragging the link in the top left corner onto your bookmarks bar.
data:text/html,
<!-- See https://gist.github.com/svincent/699c0a9027bb6bc8298b076e638718f1/edit -->
<a id="link" title="Drag this link onto your bookmark bar to save!">save scratchpad</a>
<div id="editor" contenteditable>Type something here!<div>To save, drag the link in the top right onto your bookmark bar.</div></div>
<style>
:root {
--line-height: 1.5em;
}
* {
@nemotoo
nemotoo / .gitattributes
Last active June 20, 2024 09:44
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@manuerumx
manuerumx / postJSON.cs
Last active October 20, 2021 05:39
Unity 3D example POST JSON Data to a Server with http Auth
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class goLevel : MonoBehaviour {
//With the @ before the string, we can split a long string in many lines without getting errors
private string json = @"{
'hello':'world',
'foo':'bar',
'count':25
@chandsie
chandsie / search.js
Created January 3, 2013 05:17
YouTube Search Autocomplete Example
var suggestCallBack; // global var for autocomplete jsonp
$(document).ready(function () {
$("#search").autocomplete({
source: function(request, response) {
$.getJSON("http://suggestqueries.google.com/complete/search?callback=?",
{
"hl":"en", // Language
"ds":"yt", // Restrict lookup to youtube
"jsonp":"suggestCallBack", // jsonp callback function name