This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html > body[style^='margin'] > img[style^='-webkit-user-select']:first-of-type { | |
display:block; | |
margin:0 auto; | |
box-shadow: 0 0 20px rgba(0,0,0,0.5); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python -tt | |
import sys | |
import os | |
import subprocess | |
def main(filenames): | |
for filename in filenames: | |
fcmd = "file -bi '"+filename+"'" | |
f = os.popen(fcmd,"r") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// put this in your functions.php file | |
function fixedCategoryDropdown() { | |
$categories = get_categories('depth=1'); | |
$catcount = count($categories); | |
$categorymenu = wp_dropdown_categories( | |
array( | |
// See http://codex.wordpress.org/Function_Reference/wp_dropdown_categories | |
// for all the available options | |
// These are the ones that makes sence for this example | |
'orderby' => 'name', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var optgroupArr = [], newHTML = "", currentLetter, categoryForm = $("form#cat"); | |
categoryForm.find("option").each(function(index){ | |
if (index === 0) { | |
newHTML += this.outerHTML; | |
} else if ( index > 0 ) { | |
var elFirstLetter = this.innerText.charAt(0).toLowerCase(); | |
if (index === 1) { | |
optgroupArr.push(elFirstLetter); | |
currentLetter = elFirstLetter; | |
} else if ( currentLetter === elFirstLetter ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dropbox=$(zenity --file-selection --directory) | |
filelog="" | |
for arg | |
do | |
if [ ! -f "${dropbox}/${arg}" ] && [ ! -d "${dropbox}/${arg}" ] | |
then | |
if [ -d "~/.local/share/Trash/files" ]; then | |
cp "${PWD}/${arg}" "${dropbox}/${arg}" &&\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dropbox=$(zenity --file-selection --directory) | |
filelog="" | |
for arg | |
do | |
if [ ! -f "${dropbox}/${arg}" ] && [ ! -d "${dropbox}/${arg}" ] | |
then | |
if [ -d "~/.local/share/Trash/files" ]; then | |
cp -f "${PWD}/${arg}" ~/.local/share/Trash/files &&\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
KEYWORD=$(zenity --entry --title="Search folder for..." --text="RegExp:" --entry-text ""); | |
case "$?" in | |
1 ) | |
exit 1 | |
;; | |
esac | |
if [[ "${KEYWORD}" = "" ]]; then | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php -dsafe_mode=Off | |
<?php | |
######### Bash Cron script -> crontab ######### | |
##!/bin/bash | |
#{ | |
# if [[ -z "$DBUS_SESSION_BUS_ADDRESS" ]]; then | |
# source "$HOME/.dbus/session-bus"/*-0 && export DBUS_SESSION_BUS_ADDRESS | |
# fi | |
# DISPLAY=:0.0 /home/elundmark/.bin/svtschedule.php "rapport" "320" | |
# sleep 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Your default font-size | |
$fs = 16; | |
@function px2em($target, $context: $fs) { | |
@return ( ( 1 / $context ) * $target )+0em; | |
} | |
// ---------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Mixing in python with bash we can easily retrieve our passwords securely in our shell scripts. | |
# Read this first: https://live.gnome.org/GnomeKeyring/SecurityPhilosophy | |
# Make sure your distro has gnome-keyring-daemon installed and running at login, | |
# as well as python-keyring installed (sudo apt-get install python-keyring) | |
## | |
# Follow these steps to see what it does. Verify by looking in Seahorse for your password. | |
## |