Skip to content

Instantly share code, notes, and snippets.

View ripper2hl's full-sized avatar
🎯
Focusing

Israel Perales ripper2hl

🎯
Focusing
View GitHub Profile
@sj26
sj26 / jquery.touch.js
Created June 16, 2011 02:43
Zepto touch for jQuery
(function($){
var touch = {}, touchTimeout;
function parentIfText(node){
return 'tagName' in node ? node : node.parentNode;
}
function swipeDirection(x1, x2, y1, y2){
var xDelta = Math.abs(x1 - x2), yDelta = Math.abs(y1 - y2);
if (xDelta >= yDelta) {
@sente
sente / formatXML.js
Last active April 4, 2024 12:20
javascript to format/pretty-print XML
The MIT License (MIT)
Copyright (c) 2016 Stuart Powers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@jelcaf
jelcaf / Operaciones-Git
Last active September 25, 2024 03:12
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
@schlady
schlady / tivoli.sh
Created December 16, 2011 14:07
Debian/Ubuntu init script for IBM Tivoli Storage Manager Client Schedule
#!/bin/bash
### BEGIN INIT INFO
# Provides: dsmc
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $network $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Start and stop the Tivoli Storage Client
# Description: Control the IBM Tivoli Storage Manager Client Schedule instance
### END INIT INFO
@bnerd
bnerd / index.js
Created March 10, 2012 11:54
Serve large files with Node.js
var libpath = require('path');
var http = require('http');
var fs = require('fs');
var url = require('url');
var bind_port = 8001;
var path = "/path/to/your/base_directory/";
http.createServer(function (request, response) {
var uri = url.parse(request.url).pathname;
var filename = libpath.join(path, uri);
@andrew-smith
andrew-smith / DetectFire.cpp
Created October 9, 2012 01:30
Fire detection algorithm
#include "stdafx.h"
/*
// configs
//image to load (will not load if USING_VIDEO = true)
#define IMAGE_NAME "fire2.jpg"
//video to load
#define VIDEO_NAME "flamethrower.mp4"
@plentz
plentz / nginx.conf
Last active November 14, 2024 08:35
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@kezzbracey
kezzbracey / gist:6758471
Created September 30, 2013 01:56
Aligning images in markdown / Ghost post editor.
<!--To center an image-->
<p align="center">
![alt]()
</p>
<!--To right align an image-->
<p align="right">
![alt]()
</p>
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@thoop
thoop / nginx.conf
Last active November 12, 2024 19:08
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;