Skip to content

Instantly share code, notes, and snippets.

@yusufkandemir
yusufkandemir / README.md
Created June 23, 2020 18:25
Quasar + FCM(Firebase Cloud Messaging) Setup

What to do next?

Manage The Subscription State

Manage the subscription state using localStorage, IndexedDB, or a server-side solution(e.g. in Firestore, store per-user), depending on the flow of your app.

Notification UI/UX

Create a notification section in settings, in navbar or just prompt it directly(not recommended, bad UX). On UI interaction such as a subscribe button, call subscribeNotifications with the related parameters(subscribe = true/false, token), then persist the notification state.

Create Notifications

@juniorcesarabreu
juniorcesarabreu / sharing-folder-windows-macos-vmware.md
Created March 30, 2020 22:16
Sharing a folder between windows and mac os x on vmware

You need to follow this procedure in order to share files between Windows 7 and Mac OS X on VMWare :

  1. Go in your virtual machine settings and select 'Options' tab.
  2. Click on 'Folder Sharing' and tick 'Always enabled'.
  3. Click on 'Add' button and select a folder you want to share.
  4. Confirm virtual machine settings.
  5. From 'System preferences' on Mac OS X, select 'Sharing'.
  6. Make sure that 'File Sharing' is enabled.
  7. From top menu bar, select 'Go' and 'Computer'.
  8. You will now see a folder named '/'. This is your shared folder between Windows 7 and Mac OS X.
@arccoder
arccoder / pandas-sort-within-groups.py
Created October 2, 2019 22:32
Pandas: Sort within groups
# Load the Pandas libraries with alias 'pd'
import pandas as pd
# Read csv to dataframe
df = pd.read_csv("data.csv")
# Set column types
df['Submission Date'] = pd.to_datetime(df['Submission Date'], format="%Y-%m-%d %H:%M")
print(df)
@ihciah
ihciah / README.MD
Last active June 4, 2023 01:23
V2ray MTProto through Shadowsocks

V2ray MTProto through Shadowsocks

Why use it

The MTProto is easy to block; shadowsocks is hard to identify but cannot work without a client.

You can deylop this docker image to run a relay inside the firewall (China/Russia etc.), it provide a MTProto and all the packets will be sent through shadowsocks protocol.

How to run

@eighteyes
eighteyes / gist:04c43b6e7c18d8591f2060d75f5aa68f
Created January 12, 2017 19:12
NodeJS : Spawn STDIN / STDOUT messaging to node process inside a Docker container
// This is the outside in approach, where the parent process is not within Docker, but the child lives in a docker image.
var externalNodeProcess = require('child_process').spawn('docker', [
'run',
'-a', 'stdin', '-a', 'stdout', '-a','stderr',
'-i',
'image/name:tag',
'node','index.js'
], {
stdio: ['pipe', 'pipe', 'pipe']
@joashp
joashp / openssl_encrypt_decrypt.php
Created September 4, 2015 15:59
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@adamasantares
adamasantares / scriptpath.js
Last active May 16, 2021 13:11
__FILE__ and __DIR__ in JavaScript
/**
* __DIR__ & __FILE__ for JavaScript (was tested in IE 7-10)
* This definition must be inserted at root of script file, outside of any function.
*/
(function(w,d){
var u=null;
w.__FILE__=(function(){
try{u();}catch(err){
if(err.stack){
# Resurrection Remix OS - Marshmallow
Source Code: https://github.com/ResurrectionRemix
G+: https://plus.google.com/communities/109352646351468373340
Resurrection Remix Crowdin : https://crowdin.com/project/resurrectionremix/
For extended changelog, track github activities
# The Changelog
<?php
/*
Made by Kudusch (blog.kudusch.de, kudusch.de, @Kudusch)
---------
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
@bwhite
bwhite / rank_metrics.py
Created September 15, 2012 03:23
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np