Skip to content

Instantly share code, notes, and snippets.

View mdnbras's full-sized avatar
:electron:
Working

Marcelo Daniel mdnbras

:electron:
Working
View GitHub Profile
@mdnbras
mdnbras / test.php
Created May 25, 2020 01:00 — forked from claudiosanches/test.php
Regex for test credit card brand
<?php
// Test cards
$cards = array(
'378282246310005', // American Express
'371449635398431', // American Express
'5078601870000127985', // Aura
'5078601800003247449', // Aura
'30569309025904', // Diners Club
'38520000023237', // Diners Club
@mdnbras
mdnbras / Encryption.js
Created June 24, 2019 16:25 — forked from ve3/Encryption.js
Encrypt and decrypt between programming languages (PHP & JavaScript).
/**
* Encryption class for encrypt/decrypt that works between programming languages.
*
* @author Vee Winch.
* @link https://stackoverflow.com/questions/41222162/encrypt-in-php-openssl-and-decrypt-in-javascript-cryptojs Reference.
* @link https://github.com/brix/crypto-js/releases crypto-js.js can be download from here.
*/
class Encryption {
@mdnbras
mdnbras / running.command.node.js
Created December 18, 2018 02:06 — forked from amoilanen/running.command.node.js
Running command from Node.js by spawning a new process
var spawn = require('child_process').spawn;
function spawnProcess(dir, cmd) {
return (process.platform.toLowerCase().indexOf("win") >= 0)
? spawnWindowsProcess(dir, cmd)
: spawnLinuxProcess(dir, cmd);
}
function spawnWindowsProcess(dir, cmd) {
return spawn("cmd.exe", ["/c", cmd], {cwd: dir});
@mdnbras
mdnbras / WiFiSsid.swift
Created November 27, 2018 13:32 — forked from werediver/WiFiSsid.swift
Get the connected Wi-Fi network SSID on iOS (in Swift).
import Foundation
import SystemConfiguration.CaptiveNetwork
func getWiFiSsid() -> String? {
var ssid: String?
if let interfaces = CNCopySupportedInterfaces() as NSArray? {
for interface in interfaces {
if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? {
ssid = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String
break
@mdnbras
mdnbras / gist:ad592f323cbaa9c171216d30ce949d43
Created October 24, 2017 13:39 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: