Skip to content

Instantly share code, notes, and snippets.

View RayyanNafees's full-sized avatar
🤘
Innovative than ever

Rayyan Nafees RayyanNafees

🤘
Innovative than ever
View GitHub Profile
@RayyanNafees
RayyanNafees / github-upload.js
Created January 16, 2024 15:22
Github Upload API - Dyamically create files using Github REST API shown with JS
let token = "<Github-Auth-Token>"
let fileContent = '<file-content>';
let path = '/path/to/abc.txt'
let commitMsg = 'txt file'
var content = btoa(fileContent);
uploadFileApi(token, content)
@RayyanNafees
RayyanNafees / main.dart
Last active December 28, 2023 02:54
coder-flutter
import 'package:flutter/material.dart';
void main() {
runApp( const MyApp()); //run app fills the screen so that apps and screen look cool
void answerQuestion() {
print('Answer Chosen!');
}
}
class MyApp extends StatelessWidget {
@RayyanNafees
RayyanNafees / betterpage.css
Last active November 12, 2023 11:01
Minimal CSS for making awesome content website
body {
margin: 40px auto;
max-width: 650px;
line-height:1.6;
font-size: 18px;
color: #444;
padding: 0 10px
}
h1,h2,h3{
@RayyanNafees
RayyanNafees / android-sdk.md
Last active November 11, 2023 11:22
Installing android sdk on Windows / Linux

Android SDK for React Native

Windows

  1. Install scoop
  2. Install Node, Java 17, Android Command Line Tools & ADB
scoop bucket add java extras versions
scoop install nodejs microsoft17-jdk android-clt adb
@RayyanNafees
RayyanNafees / deserialise.js
Last active September 2, 2023 18:41
Serialize & Deserialize functions in JavaScript with JSON.stringify
Function.deserialise = function(key, data) {
return (data instanceof Array && data[0] == 'window.Function') ?
new (Function.bind.apply(Function, [Function].concat(data[1], [data[2]]))) :
data
;
};
Function.prototype.toJSON = function() {
var whitespace = /\s/;
var pair = /\(\)|\[\]|\{\}/;
Function.deserialise = function(key, data) {
return (data instanceof Array && data[0] == 'window.Function') ?
new (Function.bind.apply(Function, [Function].concat(data[1], [data[2]]))) :
data
;
};
Function.prototype.toJSON = function() {
var whitespace = /\s/;
var pair = /\(\)|\[\]|\{\}/;
/**
* localForage is a fast and simple storage library for JavaScript.
* localForage improves the offline experience of your web app
* by using asynchronous storage (IndexedDB or WebSQL) with a simple, localStorage-like API.
* @see https://github.com/localForage/localForage
*/
importScripts("/lib/localforage.min.js");
/**
* ExecutionLock
@RayyanNafees
RayyanNafees / .gitignore
Last active August 18, 2023 13:37
Django Migrations .gitignore
[0-9]*_[a-z|_]*.py
@RayyanNafees
RayyanNafees / Combobox.tsx
Created July 30, 2023 18:09
Solidjs UnoCSS Combobox from TailwindUI (Iconify for Icons)
/* @unocss-include */
import {
onMount,
createSignal,
Show,
For,
onCleanup,
createEffect,
createMemo,