Skip to content

Instantly share code, notes, and snippets.

Avatar
💙
👨‍💻

Łukasz Kliś lukaszklis

💙
👨‍💻
View GitHub Profile
@lukaszklis
lukaszklis / functions.php
Created Sep 21, 2011
Check if current post in the loop is a specified post type
View functions.php
<?php
/* Your functions.php content */
function is_current_post_type($post_type) {
global $post, $wpdb;
$current_post = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_type = '" . $post_type . "' AND ID = " . $post->ID);
return $current_post;
}
@lukaszklis
lukaszklis / gist:1247306
Last active Sep 16, 2020
WordPress: check if a current page has children, if so display them, if not display all pages on the same level as current page
View gist:1247306
<?php
// Your functions.php content
function has_children() {
global $post;
$pages = get_pages('child_of=' . $post->ID);
return count($pages);
@lukaszklis
lukaszklis / gist:1313358
Created Oct 25, 2011
Podsumowanie złożenia reklamacji dot. zasięgu sieci 3G w Gdańsku w sieci Orange
View gist:1313358
#include "stdio.h"
int main() {
while (1) {
printf("Trwa usuwanie usterek przy nadajniku niedaleko Pana, powinno to zająć do 24h.\n");
}
return 0;
@lukaszklis
lukaszklis / board_messages.php
Created Dec 20, 2011
Quick fix for Board Messages Plugin for MyBB 1.6.5
View board_messages.php
Plugin has been moved into a GitHub repository: https://github.com/lukaszklis/BoardMessages
View randomizer.rb
#!/usr/bin/ruby
class Randomizer
def initialize(teams, amount)
@teams = teams
@amount = amount
end
def get
View iOS_update_checker.command
#! /bin/csh
while (1)
curl -s -L http://phobos.apple.com/version | grep -i Restore | grep -i "\(iPhone\|iPad\|iPod\)" | grep -i "6\.0"
if ($? == 1) then
echo "Nothing yet..."`date`
else
say "iOS SIX POINT OH FIRMWARE IS NOW AVAILABLE"
endif
sleep 60
end
@lukaszklis
lukaszklis / regular expression
Created Dec 18, 2012
Match links in the text which are not being inside any HTML element or as element's attribute
View regular expression
(?<!="|>)(((ht|f)tps?\:\/\/)\S+)(?!")
View animations.scss
@mixin animation-blink () {
0% { opacity: 0; }
50% { opacity: 1; }
100% { opacity: 0; }
}
View _bem-mixins.scss
// ----
// Requires Sass 3.4+
// ----
$elementSeparator: '';
$modifierSeparator: '--';
@mixin b($block) {
.#{$block} {
@content;
View keybase.md

Keybase proof

I hereby claim:

  • I am lukaszklis on github.
  • I am lukaszklis (https://keybase.io/lukaszklis) on keybase.
  • I have a public key whose fingerprint is 8491 D884 5062 1C68 05FD 7616 8231 9647 A188 0AC7

To claim this, I am signing this object: