Skip to content

Instantly share code, notes, and snippets.

@minhcasi
minhcasi / Flutter Clean.md
Last active April 25, 2024 02:33
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
@Dygear
Dygear / Working.html
Last active March 6, 2024 21:35
Google Maps JavaScript API getBounds on Polygon.
<!DOCTYPE html>
<main class="container">
<div class="row" id="map" style="height: 600px"></div>
</main>
<script src="https://maps.googleapis.com/maps/api/js?key=<!--YOURKEYHERE-->&libraries=drawing"></script>
<script>
var map, drawingManager;
function initialize() {
map = new google.maps.Map(document.getElementById('map'), {
@jennimckinnon
jennimckinnon / ngx_http_core_module
Created March 25, 2019 08:27
Enabling keep-alive on Nginx
keepalive_disable none;
@zfwf
zfwf / gist:64695924cb0941089f8163e73cfad209
Last active December 29, 2022 03:58
ubuntu openvpn configs
# Client configs, 16.04,
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
# network manager, 16.04, install below package to enable import openvpn client configs
sudo apt install network-manager-openvpn-gnome
# Client configs, 18.04/18.10
@xameeramir
xameeramir / default nginx configuration file
Last active May 4, 2024 17:27
The default nginx configuration file inside /etc/nginx/sites-available/default
# Author: Zameer Ansari
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@lologhi
lologhi / 1.How to easily implement a REST API with oAuth2 presentation.md
Last active April 4, 2024 22:13
Symfony2 : How to easily implement a REST API with oAuth2 (for normal guys)

It's still a work in progress...

Intro

As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :

@chayn1k
chayn1k / index.html
Created February 12, 2013 20:00
A CodePen by chayn1k. Interactive Particle Logo - Interactive CodePen Logo. Created with ParticleSlider. Responsive & lowers quality for mobile devices. See http://particleslider.com for more information
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>ParticleSlider</title>
</head>
<body id="particle-slider">
<div class="slides">
<div id="first-slide" class="slide" data-src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAGQCAMAAABh+/QGAAAC9FBMVEXu7u7u7u7////5+fn////u7u78/Pz7+/v////////////5+fn////////////7+/v////////////39/f////6+vr+/v76+vr////////39/f////v7+/9/f3v7+/////////+/v74+Pj////////////////////8/Pz5+fn////////////w8PD+/v7z8/P////7+/v////////9/f3u7u7////////4+Pj////////////////////////////////////u7u7////6+vr////09PT////////////////////////////////4+Pj////////y8vL////////////////////////v7+/////////////09PTu7u79/f3////////39/f////////////////////////////////////////////8/Pz////29vb////////z8/P////////////////x8fH////////////////////////z8/P////z8/P////////////////////////////////////19fX////v7+/x8fH////////////////////39/f////////w8PD////////x8fHz8/P////////////z8/P19fX////19fX////////////y8vL////29vb////x8fH////29vb////////////////////////////
@AKTed
AKTed / wp-reset-roles.php
Last active July 3, 2022 09:45
The following code will reset a WordPress default role to it's default capabilities. Note: these defaults are for WordPress 3.5, any other versions might have different defaults. To be safe, only use this code on WordPress 3.5. Warning: This cannot be undone! The role, in it's current state, is removed and recreated with the WordPress default ro…
<?php
/*
* example usage: $results = reset_role_WPSE_82378( 'subscriber' );
* per add_role() (WordPress Codex), $results "Returns a WP_Role object
* on success, null if that role already exists."
*
* possible $role values:
* 'administrator'
* 'editor'
* 'author'