Skip to content

Instantly share code, notes, and snippets.

View valeriu's full-sized avatar
🎯
Focusing

Valeriu Tihai valeriu

🎯
Focusing
View GitHub Profile
@valeriu
valeriu / scss
Created September 7, 2014 14:54
@for $i from 1 through 99 {
span:nth-child(#{$i}) {
color: lighten(#000000, $i);
}
}
@valeriu
valeriu / builder_custom_post_gallery.php
Last active August 29, 2015 14:20
builder_custom_post_gallery in wp
function builder_custom_post_gallery( $output, $attr ) {
global $post;
static $instance = 0;
$instance++;
if ( ! empty( $attr['ids'] ) ) {
// 'ids' is explicitly ordered, unless you specify otherwise.
if ( empty( $attr['orderby'] ) ) {
/*------------------------------------------------------------
* Get Attachment ID from image src
* Author: http://stylishwp.com/
============================================================*/
if ( ! function_exists( 'swp_get_attachment_id_from_src' ) ) :
function swp_get_attachment_id_from_src ( $image_src ) {
global $wpdb;
$id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid = %s", $image_src) );
return $id;
}
@valeriu
valeriu / style.css
Created March 14, 2012 01:25 — forked from luetkemj/style.css
WP-CSS: Wordpress classes
/* =============================================================================
WordPress WYSIWYG Editor Styles
========================================================================== */
.entry-content img {
margin: 0 0 1.5em 0;
max-width: 100%;
height: auto;
}
.alignleft, img.alignleft {
@valeriu
valeriu / gist:2033212
Created March 14, 2012 01:26 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@valeriu
valeriu / gist:4278968
Created December 13, 2012 19:20
Exercice 07-3 b
<html>
<head>
<title>Exercice 07-3 b</title>
</head>
<body>
<script language="JavaScript" type="text/JavaScript">
const CODE = "secret01";
const PASSE = "pizza";
@valeriu
valeriu / gist:4346942
Created December 20, 2012 17:25
Exercice 07 - Numéro 05 (Yan)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Exercice 07 - Numéro 05</title>
<meta />
</head>
<body>
<script>
@valeriu
valeriu / show-hide-div.html
Last active December 11, 2015 11:39
Show hide div on click, javascript
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test js</title>
<style>
#p2{ display:none;}
</style>
<script>
function clik()
@valeriu
valeriu / 01.html
Last active December 11, 2015 21:58
Ex 15
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>1</title>
</head>
<body>
<script language="JavaScript" type="text/JavaScript">
var couleurs, pairs, impairs;
couleurs = new Array ("cyan", "magenta", "jaune", "noir");
@valeriu
valeriu / 27-05.html
Last active December 12, 2015 08:38
Exercice 27 (5)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>05</title>
</head>
<body>
<script type="text/javascript">
var suma = 0;
var timpul;