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
package playtech.client; | |
import java.util.Random; | |
public class RandomUserGenerator { | |
private static final String[] userNames = {"john","jane"}; | |
private static final Random generator = new Random(); | |
private static final int RANGE = 100; | |
public String getUserName() |
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
Ext.define('Writer.Form', { | |
extend:'Ext.form.Panel', | |
alias:'widget.writerform', | |
requires:['Ext.form.field.Text'], | |
initComponent:function () { | |
this.addEvents('create'); | |
Ext.apply(this, { | |
activeRecord:null, |
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
$ dpkg -l | grep nvidia | |
ii bumblebee-nvidia 3.2.1-1~quantalppa4 amd64 NVIDIA Optimus support using the proprietary NVIDIA driver | |
ii libkwinnvidiahack4 4:4.10.5-0ubuntu0.1~ubuntu12.10~ppa2 amd64 library used by nvidia cards for the KDE window manager | |
ii nvidia-common 1:0.2.71.1 amd64 transitional package for ubuntu-drivers-common | |
ii nvidia-current 304.88-0ubuntu0.1 amd64 NVIDIA binary Xorg driver, kernel module and VDPAU library | |
ii nvidia-settings 304.88-0ubuntu0.2 amd64 Tool for configuring the NVIDIA graphics driver |
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
bbswitch, 0.7, 3.5.0-39-generic, x86_64: installed | |
bbswitch, 0.7, 3.5.0-40-generic, x86_64: installed | |
vboxhost, 4.2.16, 3.5.0-39-generic, x86_64: installed | |
vboxhost, 4.2.16, 3.5.0-40-generic, x86_64: installed |
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
#!/usr/bin/env bash | |
# make it chmod a+x ./git/hooks/pre-commit | |
GITCMD=$(which git) # "/usr/bin/git" | |
NULLSHA="0000000000000000000000000000000000000000" | |
MAXSIZE="5242880" # 5MB limit on file size | |
EXIT=0 | |
echo 'START PRECOMMIT CHECKING...' |
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
SET GROUP_CONCAT_MAX_LEN=10000; | |
SET @del = ( | |
SELECT CONCAT( 'DROP TABLE ', GROUP_CONCAT(CONCAT('`' , TABLE_SCHEMA , '`.`',table_name,'`')) , ';' ) | |
AS statement FROM information_schema.tables | |
WHERE | |
TABLE_SCHEMA LIKE 'MY_DB_PREFIX_%' /* Criteria for selection */ | |
OR TABLES.TABLE_NAME LIKE 'MY_TABLE_PREFIX_%'; | |
); |
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 compareAges(a,b) { | |
if (a.age < b.age) | |
return -1; | |
if (a.age > b.age) | |
return 1; | |
return 0; | |
} | |
let people = [{ name: 'John', age: '21' } , { name: 'Nick', age: 12 }, { name: 'Old' , age: 99 }]; | |
people.sort(compareAges); |
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
#!/usr/bin/env bash | |
# WD Cloud repair script will destroy all data and system partitions!!! | |
# based on http://anionix.ddns.net/WDMyCloud/WDMyCloud-Gen1/Replace%20HDD.txt | |
DEVICE=/dev/sdd | |
MOUNT_DIR=/mnt/wdcloud | |
echo 'WD Cloud repair script will destroy all data and system partitions!!!' | |
echo 'Formating device: ' ${DEVICE} |
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 output SQL for safe delete TABLES FK_KEYS even if on target DB some are missing*/ | |
SELECT | |
/* TABLE_NAME, | |
COLUMN_NAME, | |
CONSTRAINT_NAME, | |
REFERENCED_TABLE_NAME, | |
REFERENCED_COLUMN_NAME,*/ | |
concat( | |
'set @var=if((SELECT true FROM information_schema.TABLE_CONSTRAINTS WHERE | |
CONSTRAINT_SCHEMA = DATABASE() AND |
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 | |
### CURENCT SCRIPT DIR DETECTION | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
done |