Skip to content

Instantly share code, notes, and snippets.

View mihai-vlc's full-sized avatar

Mihai Ionut Vilcu mihai-vlc

View GitHub Profile
@mihai-vlc
mihai-vlc / wordpress.bat
Last active December 26, 2015 21:29
WordPress download and unzip
wget http://wordpress.org/latest.zip
unzip -q latest.zip
rm latest.zip
@mihai-vlc
mihai-vlc / resolution-debug.html
Last active December 23, 2015 22:49
JavaScript: resolution debug
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test title</title>
<script>
window.onload = function(undefined){
// container
@mihai-vlc
mihai-vlc / todo.html
Last active December 23, 2015 16:39
JavaScript: ToDo List with TogetherJS
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ToDo List</title>
<meta name="description" content="">
@mihai-vlc
mihai-vlc / Preferences.sublime-settings
Created September 16, 2013 07:28
Sublime: user preferences
{
"caret_style": "solid",
"color_scheme": "Packages/User/Monokai Soda.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store"
],
"folder_exclude_patterns":
[
@mihai-vlc
mihai-vlc / Microsoft.PowerShell_profile.ps1
Created September 15, 2013 15:13
PowerShell profile
Set-Alias subl 'C:\Program Files\Sublime Text 3\sublime_text.exe'
# https://github.com/manojlds/posz
. C:\Users\ionutvmi\Documents\WindowsPowerShell\Modules\z\posz.ps1
function prompt {
$p = Split-Path -leaf -path (Get-Location)
"$p> "
}
@mihai-vlc
mihai-vlc / Package Control.sublime-settings
Last active December 23, 2015 03:09
Sublime: installed packages
{
"installed_packages":
[
"Additional PHP Snippets",
"AdvancedNewFile",
"AndyPHP",
"Better JavaScript",
"CSS Snippets",
"CSScomb",
"Emmet",
@mihai-vlc
mihai-vlc / reload.js
Created September 12, 2013 14:28
JAVASCRIPT: reload onFocus
(function(){
__console_cheker = 0;
window.onload = function() {
if (!(window.console && (window.console.firebug || window.console.exception)) && !((window.outerWidth - window.innerWidth > 160) || (window.outerHeight - window.innerHeight > 160)))
window.onfocus = function() {
if(__console_cheker != 0)
window.location.reload(true);
}
__console_cheker++;
@mihai-vlc
mihai-vlc / open.bat
Last active December 22, 2015 07:19
:: - Windows 7 x64
@echo off
set /p var= "Which URL would you like to open?"
start "Internet Explorer" "C:\Program Files\Internet Explorer\iexplore.exe" %var%
start "Firefox" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" %var%
start "Opera" "C:\Program Files (x86)\Opera\launcher.exe" %var%
start "Safari" "C:\Program Files (x86)\Safari\Safari.exe" %var%
start "IETester" "C:\Program Files (x86)\Core Services\IETester\IETester.exe" %var%
start "Google Chrome" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" %var%
@mihai-vlc
mihai-vlc / toggle_multiple_css.js
Created July 28, 2013 16:03
JAVASCRIPT: toggle multiple css
// <link id="css_toggle" rel="stylesheet">
function toggleCss() {
// list if css urls to toggle, first one should be loaded from html for js-disabled users
var _css_urls = [
//'//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css',
'//netdna.bootstrapcdn.com/bootswatch/2.3.2/amelia/bootstrap.min.css',
'//netdna.bootstrapcdn.com/bootswatch/2.3.2/cerulean/bootstrap.min.css',
'//netdna.bootstrapcdn.com/bootswatch/2.3.2/cosmo/bootstrap.min.css',
'//netdna.bootstrapcdn.com/bootswatch/2.3.2/cyborg/bootstrap.min.css',
@mihai-vlc
mihai-vlc / toggle.js
Created July 28, 2013 14:33
JAVASCRIPT: toggleCss()
function toggleCss() {
var stylesheet, _i, _len, _ref, _results;
_ref = document.styleSheets;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
stylesheet = _ref[_i];
// we toggle the css based on it's url
if (stylesheet.href && stylesheet.href.match(/.*slate.*/)) {
_results.push(stylesheet.disabled = !stylesheet.disabled);
} else {