Skip to content

Instantly share code, notes, and snippets.

View fongreecss's full-sized avatar
:octocat:
working

Fon Greecss fongreecss

:octocat:
working
  • Slovenia
View GitHub Profile
@fongreecss
fongreecss / GalleryInfo.php
Last active April 1, 2016 11:09
Helper for Wordpress
<?php
class GalleryInfo {
private $gallery = null;
private $ids = array();
private $gallerySize = 'thumbnail';
private $imagesMetadata = array();
private function setIds() {
@fongreecss
fongreecss / dominnerhtml.php
Last active April 18, 2016 17:38
gets innerHtml of an DOM Element
<?php
function InnerHTML(DOMNode $element)
{
$innerHTML = "";
foreach ($element->childNodes as $child) {
$innerHTML .= $element->ownerDocument->saveHTML($child);
}
#!/bin/bash
alias bashrc="subl ~/.bashrc"
@fongreecss
fongreecss / nodeupdate
Last active May 12, 2016 07:55
add this function to .bashrc
#!/bin/bash
function nodeupdate() {
ARGC=$#
version=latest
if [ $ARGC != 0 ]; then
version=$1
fi
sudo npm cache clean -f
sudo npm install -g n
sudo n $version
@fongreecss
fongreecss / alertalias.sh
Last active April 27, 2016 18:33
put line in .bashrc or better in .bash_aliases
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
@fongreecss
fongreecss / nojs2js.js
Created May 2, 2016 16:35
converts html classname "no-js" to "js" if javascript is enabled
var html = document.documentElement;
html.className = html.className.replace(/\bno-js\b/g, 'js');
<?php
/**
* Plugin Name: Dequery
* Plugin URI: http://frasaleksander.github.io
* Description: Deregister new jquery and use the old one + migrate. Stocholm theme quickfix
* Version: 0.0.1
* Author: Aleksander Fras
* Author URI: http://frasaleksander.github.io
* License: GPL2
*/
#!/bin/bash
APPDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/
#!/bin/bash
curl -sL -w "%{http_code} %{url_effective}\\n" "INSERTURLHERE" -o /dev/null
#url - %{url_effective}
#code - %{http_code}
#inserturlhere - http://google.com for example
function gemsupdate(){
sudo gem update `gem list | cut -d ' ' -f 1`
}