This file contains hidden or 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
| import os | |
| import sys | |
| import urllib | |
| from pyquery import PyQuery | |
| url = 'http://dagrevis.lv' | |
| selector = 'img' | |
| storage_dir = 'temp' | |
This file contains hidden or 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
| /** | |
| * Helper: Provides that only meant database fields are changed. | |
| * | |
| * @param array $fields Fields (key, value pairs) | |
| * @param array $expected Changeable fields (just keys) | |
| * @throws HTTP_Exception_400 If any key of 1st array is not found in 2nd array, but is table column | |
| */ | |
| function check_fields($fields, $changeable) { | |
| $field_keys = array_keys($fields); |
This file contains hidden or 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
| <?php | |
| /** | |
| * Squiz_Sniffs_Strings_ConcatenationSpacingSniff. | |
| * | |
| * PHP version 5 | |
| * | |
| * @category PHP | |
| * @package PHP_CodeSniffer | |
| * @author Greg Sherwood <gsherwood@squiz.net> | |
| * @author Marc McIntyre <mmcintyre@squiz.net> |
This file contains hidden or 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
| <?php | |
| function symbolCheck($input) { | |
| return preg_match('/^[\pL0-9\:\/\.\_\-]/uD', $input); | |
| } | |
| $cases = array( | |
| 'abc:', |
This file contains hidden or 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
| $(function() { | |
| var draw_quote = function($el) { | |
| Raphael($el[0], 32, 24) | |
| .path('M32,24V12h-8c0-4.41,3.586-8,8-8V0c-6.617,0-12,5.383-12,12v12H32z M12,24V12H4c0-4.41,3.586-8,8-8V0C5.383,0,0,5.383,0,12v12H12z') | |
| .attr({ | |
| 'fill': 'black' | |
| }) | |
| ; |
This file contains hidden or 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
| $(function() { | |
| var $blockquote = $('blockquote'); | |
| if ($blockquote.length) { | |
| var $quote = $('<div />'); | |
| Raphael($quote[0], 32, 24) | |
| .path('M32,24V12h-8c0-4.41,3.586-8,8-8V0c-6.617,0-12,5.383-12,12v12H32z M12,24V12H4c0-4.41,3.586-8,8-8V0C5.383,0,0,5.383,0,12v12H12z') |
This file contains hidden or 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
| import XMonad | |
| import XMonad.Util.EZConfig | |
| main = xmonad $ defaultConfig { terminal = "xterm" } | |
| `additionalKeysP` | |
| [ ("<Print>", spawn "scrot '%Y-%m-%d_%s.png' -e 'mv $f ~/Screenshots/'") ] |
This file contains hidden or 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
| (function($){ | |
| $.fn.my_plugin = function() { | |
| return this.each(function() { | |
| var self = this; | |
| console.log($(self)); |
This file contains hidden or 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
| [dagrevis@localhost Dotfiles]$ gs | |
| # On branch master | |
| # Changes not staged for commit: | |
| # (use "git add <file>..." to update what will be committed) | |
| # (use "git checkout -- <file>..." to discard changes in working directory) | |
| # | |
| # modified: .bashrc | |
| # | |
| no changes added to commit (use "git add" and/or "git commit -a") | |
| [dagrevis@localhost Dotfiles]$ ga . |
This file contains hidden or 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
| ''.join(request.META['HTTP_HOST'].split('.')[-1:]).split(':')[0] |