Skip to content

Instantly share code, notes, and snippets.

View tinyCoder32's full-sized avatar

Rami tinyCoder32

View GitHub Profile
@ddarwisheh
ddarwisheh / context.js
Created May 28, 2021 11:27
chrome extension and context
//_________________script js______________
async function test(){
return new Promise((res,rej)=>{
setTimeout(function(){
res('test async function')
},3000)
})
}
//_________________content js______________
@minhcasi
minhcasi / Flutter Clean.md
Last active August 11, 2024 18:37
These are common issues on Flutter and solutions to fix

Quick Clean Cache

  1. Open android studio Tools->Flutter->Clean
  2. Go to File -> Invalidate Caches / Restart
  3. Or open terminal run "flutter clean"
  4. Remove pubspec.lock
  5. Double check the Flutter SDK Path config correcty - https://tppr.me/qn6dP

Or open the terminal and try this script:

flutter clean
@ross-u
ross-u / README.md
Last active July 1, 2023 20:00
M2 - Heroku Deployment (with Mongo Atlas)
@JamieMason
JamieMason / group-objects-by-property.md
Created September 14, 2018 07:38
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
easyweb-italia
4764fbb159e067e22458285444e844c313f26d6d
@tristansokol
tristansokol / index.js
Created October 21, 2017 18:41
mongodb - google cloud functions write example
exports.helloWorld = function helloWorld(req, res) {
//Connect to MongoDB Atlas
var MongoClient = require('mongodb').MongoClient;
var uri = "mongodb://user:[email protected]:27017,cluster-shard-00-01-6chsu.mongodb.net:27017,cluster-shard-00-02-6chsu.mongodb.net:27017/test?ssl=true&replicaSet=Cluster-shard-0&authSource=admin";
MongoClient.connect(uri, function(err, db) {
//check for connection errors
if (err) res.status(400).send(err);
//Read the data from the incoming request & add it to an object to insert
var message = req.body.message;
@simonhamp
simonhamp / AppServiceProvider.php
Last active November 1, 2024 18:28
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@Repox
Repox / PaginationController.php
Created November 3, 2016 11:05
Laravel 5 Pagination with transform
<?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
class PaginationController extends Controller
{
@isramv
isramv / font-awesome social round icons css.md
Created May 10, 2016 23:09
FontAwesome round social icons

Credits here: FortAwesome/Font-Awesome#4167

I agree. Use Pure css, with border-radius and a fixed width and height.

For example:

.social [class*="fa fa-"] {
    background-color: #333;
 border-radius: 30px;
@yajra
yajra / ajax-datatables-expired-session.js
Last active June 30, 2022 20:34
Laravel 5.x solution to redirect AJAX expired session to login page and disable DataTables error prompt
/**
* Requirements:
* - jQuery (http://jquery.com/)
* - DataTables (http://datatables.net/)
* - BootboxJS (http://bootboxjs.com/)
* ---------------------------------------------------------------------------
* Credits to https://gist.github.com/flackend/9517696
* ---------------------------------------------------------------------------
* This monitors all AJAX calls that have an error response. If a user's
* session has expired, then the system will return a 401 status,