⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
-module(peer). | |
-export ([draw/0]). | |
draw()-> | |
R = random:uniform(100), | |
io:format ("~w",[r]), | |
if | |
R < 33 -> | |
io:format ("Vasia peer reviews Erisa's S. Writing"); | |
true -> |
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
public static BlockInfo getBlockInfo(long blockId) { | |
int tries = RETRY_COUNT; | |
boolean done = false; | |
Session session = DBConnector.sessionFactory.getSession(); //Gets a session | |
Transaction tx = session.currentTransaction(); //Starts transaction | |
while (done == false && tries > 0) { | |
try { | |
tx.begin(); | |
BlockInfo ret = getBlockInfoInternal(blockId, session, false); | |
tx.commit(); |
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
-module(signature). | |
-export([test/0]). | |
% Looking at using Open SSH public and private keys | |
% for signing and verifying hashed data. | |
load_public_key(Filename) -> | |
{ok, SshBin} = file:read_file(Filename), | |
[{PubKey,_}] = public_key:ssh_decode(SshBin, public_key), | |
PubKey. |
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
Show hidden characters
{ | |
"auto_complete_commit_on_tab": false, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Tomorrow-Theme/Tomorrow-Night.tmTheme", | |
"default_line_ending": "unix", | |
"dictionary": "Packages/Language - English/en_GB.dic", | |
"file_exclude_patterns": | |
[ | |
".DS_Store", | |
".tags*", |
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
for i in `netstat -na |grep LISTEN |grep -v unix | tr -s ' ' | cut -d " " -f 4 |awk -F. '{print $NF}'`; do echo -e "\n*** Process listening on port $i: ***\n"; sudo lsof -i :$i; done |
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
for OG_URL in `cat og_urls.txt` | |
do | |
curl -X POST \ | |
-F "id=$OG_URL" \ | |
-F "scrape=true" \ | |
"https://graph.facebook.com" | |
done |
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
on idle | |
tell application "System Events" | |
tell current location of network preferences | |
set vpnConnection to the service "VPN" | |
-- Check if Transmission is running | |
tell application "System Events" | |
set transmissionIsRunning to (count of (every process whose name is "Transmission")) > 0 | |
end tell |
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
def caseClassToParams(cc: Product) = { | |
val fields = cc.getClass.getDeclaredFields.map(_.getName) | |
val keyValues = fields.zip(cc.productIterator.to).toList | |
keyValues.flatMap { | |
case ("foo", v) => { | |
val values = v.toString.split("&").toList | |
values.map{ p => | |
val pair = p.split("=") | |
(pair.head, pair.last) | |
} |
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/sh | |
echo "List of Github users for pubkey retrieval (space separated):" | |
read users | |
for user in $users; do | |
wget https://github.com/$user.keys -O - >> /home/deploy/.ssh/authorized_keys | |
done | |
chown -R deploy:deploy /home/deploy/.ssh |
OlderNewer