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
import tensorflow as tf | |
with tf.device('/cpu:0'): | |
a_c = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a-cpu') | |
b_c = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b-cpu') | |
c_c = tf.matmul(a_c, b_c, name='c-cpu') | |
with tf.device('/gpu:0'): | |
a_g = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a-gpu') | |
b_g = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b-gpu') |
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
// query(['remote', 'python'], ['visa','react']) | |
function query() { | |
var | |
// HN is done with very unsemantic classes. | |
job_list = Array.prototype.slice.call(document.querySelectorAll('.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')), | |
query_list = Array.prototype.slice.call(arguments), | |
shown = 0, total = job_list.length; | |
// Traverses up the dom stack trying to find a match of a specific class |
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
# -*- coding: utf-8 -*- | |
""" | |
This scripts reqire a third party module 'requests'. | |
You can get it from PyPI, i.e. you can install it using | |
easy_install or pip. | |
http://docs.python-requests.org/en/v0.10.4/ | |
Original source code is written by shin1ogawa, which is in Java. |
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
# -*- coding: utf-8 -*- | |
""" | |
This scripts reqire a third party module 'requests'. | |
You can get it from PyPI, i.e. you can install it using | |
easy_install or pip. | |
http://docs.python-requests.org/en/v0.10.4/ | |
Original source code is written by shin1ogawa, which is in Java. |
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
# sudo apt-get install: | |
# - php5 | |
# - php5-cli | |
# - php5-curl | |
# - php5-gd | |
# - php5-imagick | |
# - php5-mysql | |
# - php5-xmlrpc | |
# - php5-xdebug | |
# - php5-fpm |
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 | |
gdbus monitor -e -d com.canonical.Unity -o /com/canonical/Unity/Session | ts >> ~/lock_unlocks.txt & |
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
//1. Search for events in a certain location on etrigg.com | |
//2. Paste into console in developer window then execute | |
//3. Click on each event for the info to show up on the right side of screen | |
var eventContainer = jQuery('.container')[1]; | |
jQuery(eventContainer).css('min-width', '330px'); | |
jQuery(eventContainer).css('max-width', '50%'); | |
jQuery(eventContainer).css('float', 'left'); | |
$('.footer').remove(); |
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
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
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
ps | grep app.py | cut -c1-5 | xargs kill |