Skip to content

Instantly share code, notes, and snippets.

View betoflakes's full-sized avatar
🐛
Debugging

JR Saucedo betoflakes

🐛
Debugging
View GitHub Profile
@mskasal
mskasal / location.provider.dart
Last active October 4, 2022 19:57
Location provider for flutter projects, Riverpod, Location
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:location/location.dart';
class PersonLocationProvider extends ChangeNotifier {
Location _location = new Location();
PermissionStatus _permissionGranted;
StreamController<LocationData> currentLocation = StreamController.broadcast();
@wesbos
wesbos / fake.js
Created September 16, 2020 15:26
fake-your-git-history.js
let currentColor = '#ebedf0';
let clicking = false;
const boxes = document.querySelectorAll('.js-calendar-graph-svg rect');
const graph = document.querySelector('.js-calendar-graph-svg');
// code for switching the current color
function handleColorChange(e) {
const el = e.currentTarget;
currentColor = el.style['background-color'];
console.log(currentColor)
@GendelfLugansk
GendelfLugansk / README.md
Created August 3, 2019 18:48
Dynamically change tawk locale

If you need to change tawk's locale dynamically (i.e. in SPA), here is the code I use. There is a small issue, though - everytime tawk adds new div to body and there is no way to correctly detect it and remove (ids are dynamic and there is no classname). However, as far as it is hidden, this should not be a problem.

This has been replaced by a gem

Use gem install bunchcli to install, then run bunch -h for a list of commands.

@hjJunior
hjJunior / jwt-payload-parse.dart
Created January 15, 2019 18:00
Get payload of JWT token in Dart language
import 'dart:convert';
Map<String, dynamic> parseJwt(String token) {
final parts = token.split('.');
if (parts.length != 3) {
throw Exception('invalid token');
}
final payload = _decodeBase64(parts[1]);
final payloadMap = json.decode(payload);
@hscale
hscale / Basckup_Web_Database_Server.sh
Created November 19, 2018 10:13 — forked from ashutoshsmaurya/Basckup_Web_Database_Server.sh
Backup Web Server and Database to Google Drive - Bash Script
#!/bin/bash
#Please note - This script tested on Centos-6,7/Redhat-6,7.
#Check Internet Connection
IS=`/bin/ping -c 5 4.2.2.2 | grep -c "64 bytes"`
if (test "$IS" -gt "2") then
internet_conn="1"
#Check Gdrive Software Install Or Not
file="/usr/bin/gdrive"
if [ -f "$file" ]
then
/// flutter_background_geolocation Hello World
/// https://github.com/transistorsoft/flutter_background_geolocation
////
// For pretty-printing location JSON. Not a requirement of flutter_background_geolocation
//
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_background_geolocation/flutter_background_geolocation.dart'
@nickcernis
nickcernis / readme.md
Last active June 2, 2024 18:31
Exclude node_modules and .git from Backblaze backups on Mac

Exclude node_modules and .git from Backblaze backups on Mac

  1. Edit the file at /Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml.
  2. Add these rules inside the bzexclusions tag:
<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
@superjose
superjose / .gitlab-ci.yml
Last active February 19, 2024 10:22
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
{
"editor.multiCursorModifier": "ctrlCmd",
"editor.snippetSuggestions": "top",
"editor.formatOnPaste": true,
"editor.fontFamily" : "Fira Code",
"editor.fontLigatures": true,
"emmet.triggerExpansionOnTab": true,
"php.suggest.basic": false,
"editor.autoIndent": true,
"emmet.includeLanguages" : {