Skip to content

Instantly share code, notes, and snippets.

View VasilSlavchev's full-sized avatar

Vasil Slavchev VasilSlavchev

View GitHub Profile
@cowboy
cowboy / very-small-ie-detect.js
Created August 21, 2010 13:26 — forked from padolsey/gist:527683
Very small IE detect (aka type coersion ftw)
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 6) then:
// ie === 0
// If you're in IE (>=6) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@ozh
ozh / get_favicon.md
Created May 4, 2014 20:40
Most standard ways to get a favicon from a page

Most standard ways to get a favicon from a page, in preferred order

In file:

  • <link href="http://someserver/favicon.ico" rel="shortcut icon" />
  • <link href="http://someserver/favicon.ico" rel="shortcut" />
  • <link href="http://someserver/favicon.ico" rel="icon" />
  • <link href="http://someserver/favicon.png" rel="apple-touch-icon" />
  • <link href="http://someserver/favicon.png" rel="apple-touch-icon-precomposed" />
  • <link href="http://someserver/favicon.ico" rel="image_src" />
@benwo
benwo / meta-tags.html
Last active May 13, 2024 21:44
Standard meta tags and meta image tags (and sizes).
<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/Organization" lang="en">
<head>
<!-- Settings -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Search Engines -->
@DavidWells
DavidWells / reset.css
Last active November 13, 2024 09:16 — forked from karbassi/reset.css
CSS reset. Follow me on the twitters for more tips: https://twitter.com/davidwells
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 19, 2024 11:04
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@nullrndtx
nullrndtx / simpleDirectoryLister.php
Created January 30, 2016 14:14
A simple PHP Directory Lister
<?php
/*
*** OPTIONS ***/
// TITLE OF PAGE
$title = "List of Files";
// ADD SPECIFIC FILES YOU WANT TO IGNORE HERE
$ignore_file_list = array( ".htaccess", "Thumbs.db", ".DS_Store", "index.php" );
<!DOCTYPE html>
<html>
<head><title>SOUND</title></head>
<body>
<div>Frequence: <span id="frequency"></span></div>
<script type="text/javascript">
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var oscillatorNode = audioCtx.createOscillator();
var gainNode = audioCtx.createGain();
@oropesa
oropesa / encrypt-decrypt.php
Last active June 10, 2022 16:05
Encrypt and decrypt in php
$string = "Hello World";
$encrypted = oro_encrypt_string( $string );
$decrypted = oro_decrypt_string( $encrypted );
echo $string . '<br />' . $encrypted . '<br />' . $decrypted;
function oro_encrypt_string( $string, $key = '', $iv = '', $method = '' ) {
$encrypt_method = empty( $method ) ? 'AES-256-CBC' : $method;
$secret_key = empty( $key ) ? 'random' : $key;