Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bars waves</title>
</head>
<body style="background: #545454">
<div class="animated-bars">
<div class="bar"></div>
<div class="bar"></div>
var links = 'https://leaseweb.com/en/en/,https://leaseweb.com/en/en/about,https://leaseweb.com/en/en/add-ons/backup,https://leaseweb.com/en/en/add-ons/private-networking,https://leaseweb.com/en/en/add-ons/sla,https://leaseweb.com/en/en/afas-erp-software-home-pg,https://leaseweb.com/en/en/apac,https://leaseweb.com/en/en/bare-metal-feedback,https://leaseweb.com/en/en/bare-metal-server,https://leaseweb.com/en/en/bare-metal-server/all-servers,https://leaseweb.com/en/en/bare-metal-server/dual-processor,https://leaseweb.com/en/en/bare-metal-server/features,https://leaseweb.com/en/en/bare-metal-server/quad-processor,https://leaseweb.com/en/en/bare-metal-server/single-processor,https://leaseweb.com/en/en/careers,https://leaseweb.com/en/en/cdn,https://leaseweb.com/en/en/cdn/enterprise,https://leaseweb.com/en/en/cdn/features,https://leaseweb.com/en/en/cdn/free-trial,https://leaseweb.com/en/en/cdn/pay-as-you-go,https://leaseweb.com/en/en/certifications,https://leaseweb.com/en/en/certifications/process,https://leaseweb.
sudo /etc/init.d/mysql stop
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
mysql -u root
UPDATE mysql.user SET Password=PASSWORD('') WHERE User='root';
FLUSH PRIVILEGES;
exit;
sudo /etc/init.d/mysql restart
<?php
$path = 'D:\\photos\\';
$extToDelete = 'DNG';
$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
foreach ($it as $item) {
if (!$item->isDir()) {
if ($item->getExtension() == $extToDelete) {
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
css: {
src: [
'css/*'
],
dest: 'combined.css'
},
@andrejko
andrejko / parseDate.js
Last active December 19, 2015 05:59
Proper date parsing in Javascript
/* Proper date parsing. Works in Safari */
function parseDate(input) {
var parts = input.match(/(\d+)/g);
return new Date(parts[0], parts[1]-1, parts[2]);
}
(function () {
var preTags = document.getElementsByTagName('pre');
var preWithHeaderInfo = preTags[0];
var preWithContent = preTags[2];
var lines = preWithContent.textContent.split('\n');
var text = '';
for (var i = 0; i < lines.length; i++) {
var line = lines[i];
var firstIndex = 11; // first index of the chars to match
var indexJump = 4;
@andrejko
andrejko / deviantOauth.php
Last active December 15, 2015 04:19
Oauth for DeviantArt
<?php
//Relies on the oAuth2 library by Pierrick Charron: https://github.com/adoy/PHP-OAuth2/
const CLIENT_ID = '***'; // OAuth 2.0 client_id
const CLIENT_SECRET = '***'; // OAuth 2.0 client_secret
const REDIRECT_URI = 'http://getcoolphoto.com/site/deviant';
const AUTHORIZATION_ENDPOINT = 'https://www.deviantart.com/oauth2/draft15/authorize';
const TOKEN_ENDPOINT = 'https://www.deviantart.com/oauth2/draft15/token';
const SUBMIT_API = "http://www.deviantart.com/api/draft15/stash/submit";