Skip to content

Instantly share code, notes, and snippets.

View jacksonfdam's full-sized avatar
💻
Coding...

Jackson F. de A. Mafra jacksonfdam

💻
Coding...
View GitHub Profile
@nikic
nikic / password_hashing_api.md
Created September 12, 2012 15:04
The new Secure Password Hashing API in PHP 5.5

The new Secure Password Hashing API in PHP 5.5

The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:

Why do we need a new API?

Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.

@zenorocha
zenorocha / Foca no código
Created August 27, 2012 14:42
Foca no código
/* Véi, foca no código
.---.
/o o\
__(= " =)__
//\'-=-'/\\
) (_
/ `"=-._
/ \ ``"=.
@henriquemoody
henriquemoody / sql_formater.php
Created August 7, 2012 00:12 — forked from augustohp/sql_formater.php
SQL formater for PHP by @alganet
function formatSql($sql) {
return preg_replace(
'/(select|from|(left |right |natural |inner |outer |cross |straight_)*join|where|limit|update |set|insert |values)/i',
"\n$1\n ", str_replace("\n", '', $sql)
);
}
@grifo
grifo / fizzbuzz-fibo.js
Created August 2, 2012 12:05
Desafios do Code n' Bier de 01 agosto de 2012
function fizzbuzz(a, b) {
for (var i = a; i <= b; i++) {
if (i % 3 == 0 && i % 5 == 0) {
console.log("Fizzbuzz");
} else if (i % 5 == 0) {
console.log("Buzz");
} else if (i % 3 == 0) {
console.log("Fizz");
} else {
console.log(i);
@christopherperry
christopherperry / adb+
Created July 30, 2012 16:12
A bash script that let's you issue adb commands to multiple devices at once
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@TCotton
TCotton / doodle.js
Created July 16, 2011 18:17
Using doodle.js HTML Canvas framework
function html5_canvas() {
// declare variables
var $canvas, $element, $circle, $rect, $triangle, $x, $limit, $angle, $centerY, $range, $speed;
//dom block element wrapper
$element = doodle.createDisplay("canvas");
//creates new canvas element wrapper
$canvas = $element.createLayer();
// function to create a random number
@TCotton
TCotton / fabric.js
Created July 14, 2011 19:14
Creates pretty shapes with fabric.js
function html5_canvas() {
// declear variables
var $canvas, $rect, $circle, $triangle, $i, $limit, $width, $height;
//create canvas object with div id
$canvas = new fabric.Canvas('canvas_1');
// create Circle - note radius
@akagomez
akagomez / gist:1025933
Created June 14, 2011 21:26 — forked from hunterloftis/gist:1025903
Install Git, Node, NPM, Nginx, PHP (Fast CGI), CouchDB, and MySQL on Ubuntu 10.04 LTS
# This should be run on a new Linode Ubuntu 32-bit 10.04 image as root to prepare it for Nginx, PHP, MySQL, Node, CouchDB environment
# To start, something like this works:
# scp prepare_server.sh root@123.456.789.10:/root
# First, install basic linux utilities (compilers, git, libssl)
cd /root
mkdir /src
cd src
@chrisjacob
chrisjacob / README.md
Created February 18, 2011 03:44
Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result