Skip to content

Instantly share code, notes, and snippets.

View jsmsalt's full-sized avatar
🎯
Focusing

José Morales jsmsalt

🎯
Focusing
View GitHub Profile
@crtr0
crtr0 / client.js
Created June 8, 2012 17:02
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@bernardodiasc
bernardodiasc / gist:6201879
Created August 10, 2013 19:46
Meta Tags SEO
<!-- The Metas Output -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="imagetoolbar" content="no" />
<meta http-equiv="content-language" content="pt-BR" />
<meta name="viewport" content="width=device-width" />
<meta name="robots" content="index,follow" />
<meta name="generator" content="{website-generator}" />
<meta name="author" content="{website-name}" />
<meta name="copyright" content="© {this-year} {website-name}" />
@jenkek
jenkek / gist:8858278
Last active September 7, 2017 15:42
meta tags for seo
<meta name="description" content="Большинство поисковых серверов отображают содержимое поля description при выводе результатов поиска. Если этого тега нет на странице, то поисковый движок просто перечислит первые встречающиеся слова на странице, которые, как правило, оказываются не очень-то и в тему." />
<meta name="Keywords" content="HTML, META, метатег, тег, поисковая система" />
<!-- The Open Graph protocol -->
<!-- description: http://ogp.me/#metadata -->
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
<!-- array: http://ogp.me/#array -->
@fhferreira
fhferreira / haversine.php
Last active January 19, 2021 14:44
Haversine Method for model Laravel.
<?php
/*
* find the n closest locations
* @param Model $query eloquent model
* @param float $lat latitude of the point of interest
* @param float $lng longitude of the point of interest
* @param float $max_distance distance in miles or km
* @param string $units miles or kilometers
* @param Array $fiels to return
* @return array
@magnetikonline
magnetikonline / README.md
Last active December 14, 2023 06:45
Nginx FastCGI cache configuration example.

Nginx FastCGI cache

Example /etc/nginx/nginx.conf using FastCGI (e.g. to PHP-FPM) with FastCGI cache enabled. This will capture returned data and persist it to a disk based cache store for a configurable amount of time, great for robust full page caching.

Will need to create a directory to hold cache files, for the example given here that would be:

$ sudo mkdir -p /var/cache/nginxfastcgi
$ chown www-data: /var/cache/nginxfastcgi
@HossamYousef
HossamYousef / Facebook-brute-force.py
Last active December 17, 2023 11:46
This simple script to penetrate accounts Facebook brute-force
#!/usr/bin/python
#Install SleekXMPP & xmpppy Modules
#This program is not for children -(18)
#This program is only for educational purposes only.
#Don't Attack people facebook account's it's illegal !
#If you want to HaCk into someone's account, you must have the permission of the user.
#usage:Facebook-brute-force.py [wordlist file]
#Coded By Hossam Youssef <hossam.mox@gmail.com> ^_^
@davidvandenbor
davidvandenbor / seo-social-media-meta-tags.html
Last active May 19, 2024 13:09
SEO Social Media Meta Tags
<!-- SEO / Google -->
<meta name="author" content="Author name here....">
<meta name="description" content="Description text here.....">
<link rel="canonical" href="URL here...">
<!-- Social: Twitter -->
<!-- After inserting META need to validate at https://dev.twitter.com/docs/cards/validation/validator -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@8bit_code">
<meta name="twitter:creator" content="8bit_code">
<!-- Meta-теги для Facebook: -->
<meta property="og:title" content=""/>
<meta property="og:description" content=""/>
<meta property="og:image" content=""/>
<meta property="og:site_name" content=""/>
<meta property="og:url" content=""/>
<!-- Meta-теги для Twitter: -->
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content=""/>
@frntn
frntn / gist:f25726df962fc29c6dde
Last active November 1, 2023 15:18
azure-cli cheatsheet
azure
account
list [options] #List the imported subscriptions
show [options] [subscriptionNameOrId] #Show details about a subscription
set [options] <subscriptionNameOrId> #Set the current subscription
clear [options] #Remove a subscription or environment, or clear all of the stored account and environment info
import [options] <file> #Import a publishsettings file or certificate for your account
download [options] #Launch a browser to download your publishsettings file
env... #Commands to manage your account environment
@parente
parente / postinstall.sh
Last active April 23, 2024 06:11
Post-install script to disable SSH password authentication, install latest Docker with AUFS on Ubuntu 14.04 VMs
#!/bin/bash
# Disable password authentication
sudo grep -q "ChallengeResponseAuthentication" /etc/ssh/sshd_config && sed -i "/^[^#]*ChallengeResponseAuthentication[[:space:]]yes.*/c\ChallengeResponseAuthentication no" /etc/ssh/sshd_config || echo "ChallengeResponseAuthentication no" >> /etc/ssh/sshd_config
sudo grep -q "^[^#]*PasswordAuthentication" /etc/ssh/sshd_config && sed -i "/^[^#]*PasswordAuthentication[[:space:]]yes/c\PasswordAuthentication no" /etc/ssh/sshd_config || echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
sudo service ssh restart
# Install latest Docker
sudo apt-get update
sudo apt-get -y install linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"