Skip to content

Instantly share code, notes, and snippets.

@jayluxferro
jayluxferro / using-raw-socket-io-in-sails.js
Created August 25, 2018 12:21 — forked from mikermcneil/using-raw-socket-io-in-sails.js
Using raw socket.io functionality in a Sails.js controller
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {
@jayluxferro
jayluxferro / Calculate_Lat_Lng_Distance_gmaps-JS.md
Created August 21, 2018 19:42
Calculate Latitude Longitude Distance
function getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2) {
  var R = 6371; // Radius of the earth in km
  var dLat = deg2rad(lat2-lat1);  // deg2rad below
  var dLon = deg2rad(lon2-lon1); 
  var a = 
    Math.sin(dLat/2) * Math.sin(dLat/2) +
    Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * 
    Math.sin(dLon/2) * Math.sin(dLon/2)
 ; 
@jayluxferro
jayluxferro / Google_maps_route_display-JS.md
Created August 21, 2018 19:39
Google Maps Route - javascript
function mapLocation() {
    var directionsDisplay;
    var directionsService = new google.maps.DirectionsService();
    var map;

    function initialize() {
        directionsDisplay = new google.maps.DirectionsRenderer();
        var chicago = new google.maps.LatLng(37.334818, -121.884886);
        var mapOptions = {
@jayluxferro
jayluxferro / Google_map_auto_update.md
Created August 19, 2018 12:31
Google maps autoupdate
<!DOCTYPE html >
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Drifter</title>

    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript">
        //<![CDATA[
@jayluxferro
jayluxferro / GitNPMConfigHttpProxy.md
Last active August 9, 2018 09:15 — forked from evantoli/GitConfigHttpProxy.md
Configure Git/NPM to use a proxy

Configure Git to use a proxy

##In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@jayluxferro
jayluxferro / Google_maps_route_display.md
Created August 8, 2018 12:56
Google maps route display

Google maps route display

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
    <script type="text/javascript">

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@jayluxferro
jayluxferro / Aircrack Commands
Last active August 22, 2022 23:14 — forked from victorreyesh/Aircrack Commands
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
//Install Macports.
//Install aircrack-ng:
sudo port install aircrack-ng
//Install the latest Xcode, with the Command Line Tools.
//Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport
//Figure out which channel you need to sniff:
sudo airport -s
sudo airport en1 sniff [CHANNEL]
@jayluxferro
jayluxferro / NPM_Permission_Error.md
Created July 22, 2018 19:45
NPM EACCESS Installer error fix
sudo npm install -g [package name] --unsafe-perm=true --allow-root
php pdo set up on mac osx
copy /etc/php.ini.default and rename it /etc/php.ini
Edit your /etc/php.ini :
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
; http://php.net/pdo_mysql.default-socket
#pdo_mysql.default_socket=/var/mysql/mysql.sock