Skip to content

Instantly share code, notes, and snippets.

View ivarsmas's full-sized avatar
👨‍💻

Mike Ivars ivarsmas

👨‍💻
View GitHub Profile
@remmel
remmel / facebook-messenger-bot.php
Last active November 5, 2021 18:01
Basic example of a Facebook Messenger Bot
<?php
// parameters
$hubVerifyToken = 'TOKEN123456abcd';
$accessToken = "xxx";
// check token at setup
if ($_REQUEST['hub_verify_token'] === $hubVerifyToken) {
echo $_REQUEST['hub_challenge'];
exit;
}
@gtallen1187
gtallen1187 / slope_vs_starting.md
Created November 2, 2015 00:02
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

@BCasal
BCasal / Colaborar Proyecto GitHub.markdown
Last active October 5, 2025 20:08
Pasos a seguir para colaborar en un proyecto de GitHub

Cómo colaborar en un proyecto en GitHub

  • Fork del repositorio
  • Clonar el repositorio
  • Actualizar la rama master
  • Crear una rama
  • Hacer los cambios
  • Hacer un Pull Request

Fork del repositorio

@marcinkrzeminski
marcinkrzeminski / index.html
Created January 22, 2015 12:26
jQuery Mask IBAN
<input type="text" name="field-name" class="field-name" />
@vivirenremoto
vivirenremoto / gist:5052719
Last active December 14, 2015 07:48
Detecta el dispositivo móvil y redirige a su versión correspondiente con un sólo código QR
<?php
$user_agent = $_SERVER['HTTP_USER_AGENT'];
switch( true ){
case preg_match('/iphone|ipad/si',$user_agent):
$url = 'https://itunes.apple.com/us/app/whatsapp-messenger/id310633997?mt=8';
break;
case stristr($user_agent, 'android'):
@iwek
iwek / find-in-json.js
Created October 20, 2012 21:43
Searching through JSON
//return an array of objects according to key, value, or key and value matching
function getObjects(obj, key, val) {
var objects = [];
for (var i in obj) {
if (!obj.hasOwnProperty(i)) continue;
if (typeof obj[i] == 'object') {
objects = objects.concat(getObjects(obj[i], key, val));
} else
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not)
if (i == key && obj[i] == val || i == key && val == '') { //
@martinsik
martinsik / chat-frontend.js
Last active August 12, 2025 15:58
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;