Skip to content

Instantly share code, notes, and snippets.

@paragonie-scott
paragonie-scott / autoload.php
Created May 14, 2017 16:58
defuse/php-encryption autoloader
<?php
define('DEFUSE_CRYPTO_BASEDIR', __DIR__.'/src/');
/**
* PSR-4 compatible autoloader
*
*/
\spl_autoload_register(function ($class) {
// Project-specific namespace prefix
@nguyenlinhnttu
nguyenlinhnttu / 19: Thư viện Glide
Last active August 10, 2022 08:25
Tổng hợp các đoạn code hữu ích cho lập trình android - Chia sẻ code hay để dễ dàng tìm kiếm khi cần sử dụng. Xem thêm : https://goo.gl/agdWhl
Tiếng việt: https://goo.gl/vKRQQn
Tiếng Anh: https://goo.gl/8qsB7s
@JamesMessinger
JamesMessinger / IndexedDB101.js
Last active April 4, 2024 02:00
Very Simple IndexedDB Example
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"});
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@rajapaju
rajapaju / facebook-login.sh
Created October 12, 2011 18:00 — forked from hubgit/facebook-login.sh
Login to Facebook using cURL
#!/bin/bash
# If it redirects to http://www.facebook.com/login.php at the end, wait a few minutes and try again
EMAIL='YOUR_EMAIL' # edit this
PASS='YOUR_PASSWORD' # edit this
COOKIES='cookies.txt'
USER_AGENT='Firefox/3.5'