Skip to content

Instantly share code, notes, and snippets.

View gpedro's full-sized avatar

Gabriel Pedro gpedro

View GitHub Profile
@crofty
crofty / index.html
Last active October 22, 2021 08:24
A example of using Google Map tiles with the Leaflet mapping library - http://matchingnotes.com/using-google-map-tiles-with-leaflet
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script>
</head>
<body>
@yamanyar
yamanyar / sample.py
Created April 7, 2012 05:07
resolving in python
#!/usr/bin/python
# Rewrite URL Script for Secure Web Issue
# author: Kaan Yamanyar
from Crypto.Cipher import DES
from datetime import datetime, timedelta
import sys
import re
import base64
def parseToken(str):
@yamanyar
yamanyar / encrypt.java
Created April 7, 2012 05:08
encrypt in java
protected String encrypt(String token) throws Exception {
// Instantiate the cipher
final SecretKeySpec key = new SecretKeySpec("oldhouse".getBytes("ISO-8859-1"), "DES");
AlgorithmParameterSpec paramSpec = new IvParameterSpec("houseold".getBytes());
Cipher cipher = Cipher.getInstance("DES/CFB8/NoPadding");
cipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
byte[] binaryData = cipher.doFinal(token.getBytes("ISO-8859-1"));
return new String(org.apache.commons.codec.binary.Base64.encodeBase64(binaryData), "ISO-8859-1");
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active October 25, 2024 12:37
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@fdaciuk
fdaciuk / Esconder_console_log.md
Last active September 3, 2021 15:00
Esconder console.log() quando o site for para produção

Esconder console.log() para o site em produção

  • Trocar o www.mywebsite.com pelo endereço do site em produção;
  • Incluir isso no início do seu script.

Se passar o parâmetro ?development na URL, ele ignora e mostra os console.log().

@coderanger
coderanger / README.md
Last active August 18, 2023 18:33
How to patch Ubuntu for Heartbleed

How to patch Ubuntu for Heartbleed

  1. sudo apt-get update
  2. sudo apt-get install -y libssl1.0.0 openssl
  3. openssl version -a and confirm the "built on" date is >= 2014-04-07
  4. sudo lsof -n | grep ssl | grep DEL and restart all listed services.

Repeat #4 until no results are returned.

@felipefialho
felipefialho / aproximando-seus-estudos-de-cenarios-reais.md
Last active February 25, 2019 14:13
Aproximando seus estudos de cenários mais reais

Teoria x Prática

Aproximando seus estudos de cenários mais reais

O problema

Uma das perguntas mais comuns entre desenvolvedores iniciantes ou que ainda estão em fase de estudos, é:

@jctosta
jctosta / screen_cheatsheet.markdown
Last active October 28, 2024 17:41
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@kpdecker
kpdecker / nodebf.md
Last active June 2, 2016 18:02
mobile.walmart.com #nodebf 2014

Mobile Server Side Rendering

This year marks the first year that we are doing full scale rendering of our SPA application on our mobile.walmart.com Node.js tier, which has provided a number of challenges that are very different from the mostly IO-bound load of our prior #nodebf.

The infrastructure outlined for last year is the same but our Home, Item and a few other pages are prerendered on the server using fruit-loops and hula-hoop to execute an optimized version of our client-side JavaScript and provide a SEO and first-load friendly version of the site.

To support the additional CPU load concerns as peak, which we hope will be unfounded or mitigated by our work, we have also taken a variety of steps to increase cache lifetimes of the pages that are being served in this manner. In order of their impact:

Event Loop Management

Over the last couple months we noticed some community stagnation and big performance issues with DocPad. Because of that, and few other problems that appeared to be far from being solved, we decided to move to a new stack #109.

What changed?

For backward compatibility purposes, we decided to keep all folders and all automated task commands with the exact same name.

New features should be expected in upcoming versions, this release is intended to be a 1:1 mapping.

Architecture