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
| #!/bin/bash | |
| DEVICE_NAME="DualPoint Stick" | |
| echo "device: $DEVICE_NAME" | |
| enabled=`xinput --list-props "$DEVICE_NAME" | grep -e "Device Enabled\ (126):\s*1"` | |
| if [ -n "$enabled" ]; then | |
| xinput --set-prop "$DEVICE_NAME" "Device Enabled" 0 | |
| else | |
| xinput --set-prop "$DEVICE_NAME" "Device Enabled" 1 | |
| fi |
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
| check_url() { | |
| [ -z "$1" ] && { | |
| puts-warn "No url provided" | |
| exit 1 | |
| } | |
| echo "$1" | |
| STATUS=${2:-"200"} | |
| return $(curl -o /dev/null -s -f -m 10 --head --write-out '%{http_code}\n' "$1" | grep -q $STATUS) | |
| } |
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
| #celery | |
| import os | |
| if (os.path.exists('/tmp/celery_break')): | |
| from celery.contrib.rdb import Rdb; Rdb(host='127.0.0.1', port=6899).set_trace() | |
| #usual | |
| import ipdb; ipdb.set_trace() |
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
| create table a (id integer, expired boolean, version integer); | |
| insert into a values (1, false, 1); | |
| insert into a values (2, false, 1); | |
| -- in t1 | |
| begin; | |
| select 1 from a where expired = false and id = 1 for update; |
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
| println Locale.getDefault() |
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
| <insert id="setIndexingDataByQuery"> | |
| WITH affected_documents AS ( | |
| SELECT d.id, d.ltx_id | |
| FROM document_head AS d | |
| WHERE $_parameter.whereClause | |
| AND d.state != 'DELETED' | |
| ), updated AS ( | |
| UPDATE indexing_data idt | |
| SET data = <include refid="dataArray"/>, | |
| <!-- this field is not used in hierarchical transformers and is for consistency only --> |
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
| romanko@E6520:~/work/workspace/coredata$ script/coredata setup | |
| -----> Stopping coredata | |
| -----> Dropping data directory /home/romanko/work/workspace/coredata/data/develop/sjon | |
| -----> Writing configuration to '.genenv' | |
| -----> Configuring customer | |
| -----> Creating Virtualenv version 1.7.1.2 | |
| The --no-site-packages flag is deprecated; it is now the default behavior. | |
| New python executable in /home/romanko/work/workspace/coredata/bin/python2.7 | |
| Also creating executable in /home/romanko/work/workspace/coredata/bin/python | |
| Installing distribute.............................................................................................................................................................................................done. |
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
| Мои друзья с Восточной Украины часто спрашивают - сколько же действительно платят на Майдане? Их беспокойство легко понять - ведь цифры в разніх источниках очень разнятся. Стоит ли бросить родной завод и ехать в Киев на заработки? Я устал отвечать каждому лично, поэтому вот вам сводный прайс: | |
| ПРЕЙСКУРАНТ ЦЕН НА УСЛУГИ ЕВРОМАЙДАНА ДЛЯ ЧАСТНЫХ ЛИЦ | |
| 1. Участие в шествии в качестве пешехода: 1 $ за каждые 50 метров. | |
| При движении в горку тариф удваивается. Движение вниз по склону оплачивается по сниженному тарифу. | |
| 2. Махание флагом на шествии – 1 доллар за каждый мах. |
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
| #! /bin/bash | |
| # Author: Shirish Padalkar (https://twitter.com/_Garbage_) | |
| if [ "$#" -ne 1 ]; then | |
| echo "Usage: $0 infoq_presentation_url" | |
| exit 1 | |
| fi | |
| url_with_spaces=`curl -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" $1 | grep "<source src=" | tr -dc "[:print:]"` |
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 java.lang.management.* | |
| import javax.management.ObjectName | |
| import javax.management.remote.JMXConnectorFactory as JmxFactory | |
| import javax.management.remote.JMXServiceURL as JmxUrl | |
| import groovy.swing.SwingBuilder | |
| import javax.swing.WindowConstants as WC | |
| def cli = new CliBuilder(usage:'jmx-query [options]', | |
| header:'Options:') | |
| cli.help('displays help') |
OlderNewer