Skip to content

Instantly share code, notes, and snippets.

@higepon
higepon / gist:b4a0be68c6185c5f31e03b50d3339a4d
Created July 15, 2019 08:17
user css for kibela to hide some headers
.noteHeader-author { display: none }
.noteActionBar { display: none }
.noteHeader-groups { display: none }
.noteHeader-titleFooter { display: none }
.noteHeader-title {font-size: 20pt }
Requirement already satisfied: easy-tf-log[tf] from git+https://github.com/mrahtz/easy-tf-log#egg=easy-tf-log[tf] in /usr/local/lib/python3.6/dist-packages
Requirement already satisfied: tensorflow in /usr/local/lib/python3.6/dist-packages (from easy-tf-log[tf])
Requirement already satisfied: protobuf>=3.4.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow->easy-tf-log[tf])
Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow->easy-tf-log[tf])
Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.6/dist-packages (from tensorflow->easy-tf-log[tf])
Requirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow->easy-tf-log[tf])
Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow->easy-tf-log[tf])
Requirement already satisfied: gast>=0.2.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow->easy-tf-log[tf])
Requirement already satisfie
@higepon
higepon / seq2seq.py
Last active August 1, 2023 09:05
Minimum Seq2Seq implementation using Tensorflow 1.4/1.5 API
import numpy as np
import tensorflow as tf
from tensorflow.python.layers import core as layers_core
hparams = tf.contrib.training.HParams(
batch_size=3,
encoder_length=4,
decoder_length=5,
num_units=6,
src_vocab_size=7,
@higepon
higepon / gist:ba1af2e19e8ffcdb7f2a
Created July 14, 2015 23:02
Example of @IBDesignable without overdiding drawRect
extension UIColor {
convenience init(hex: Int, alpha: CGFloat = 1.0) {
let red = CGFloat((hex & 0xFF0000) >> 16) / 255.0
let green = CGFloat((hex & 0xFF00) >> 8) / 255.0
let blue = CGFloat((hex & 0xFF)) / 255.0
self.init(red:red, green:green, blue:blue, alpha:alpha)
}
}
@IBDesignable class AvatarView : UIImageView {
@higepon
higepon / Compatible.h
Created July 14, 2014 03:28
iOS7 and iOS8 Compatible Push Notifications Registrations
#import <Foundation/Foundation.h>
@interface Compatible : NSObject
+ (void)registerPush:(UIApplication *)application;
@end
@higepon
higepon / API.swift
Last active July 31, 2023 16:00
An example of JSON API call in Swift
//
// API.swift
//
// Created by Taro Minowa on 6/10/14.
// Copyright (c) 2014 Higepon Taro Minowa. All rights reserved.
//
import Foundation
typealias JSONDictionary = Dictionary<String, AnyObject>
class func createFromJson(roomObj: Dictionary<String, AnyObject>) -> Room! {
if let id = roomObj["id"]? as? Int {
if let name = roomObj["name"]? as? String {
if let userObj = roomObj["user"]? as? Dictionary<String, AnyObject> {
if let user = User.createGuestFromJson(userObj) {
if let messageCount = roomObj["message_count"]? as? Int {
if let isRemoved = roomObj["removed"]? as? Bool {
if let dateString = roomObj["created_at"]? as? String {
let formatter = NSDateFormatter()
@higepon
higepon / mige.json
Last active December 14, 2015 21:09
{
"Twitter": "twitter://post?message=",
"directions to Twitter": "comgooglemaps://?saddr=&daddr=Suite+900:+1355+Market+St:+San+Francisco:+CA&directionsmode=transit",
"Twitter": "twitter://post?message=",
"Facebook": "fb://publish/?text=",
"home": "twitter://timeline",
"connect": "twitter://mentions",
"Gmail": "googlegmail://co?subject=&body=&[email protected]",
"camera": "camplus://",
"Foursquare": "foursquare://",
@higepon
higepon / ack
Created December 26, 2012 05:58
Use ack from Emacs. Wand to remove the last "interactive". Any suggestions?
(defun ack (directory keyword)
(setq default-directory (if (string= "dired-mode" major-mode)
(dired-current-directory)
(file-name-directory (buffer-file-name (current-buffer)))))
(interactive "D:What directory? \ns:keyword? ")
(grep-apply-setting 'grep-find-command (format "ack --nocolor --nogroup %s %s" keyword directory))
(call-interactively 'grep-find))
@higepon
higepon / gist:1574075
Last active September 29, 2015 08:28
brew install -v cdrtools
==> Downloading ftp://ftp.berlios.de/pub/cdrecord/cdrtools-3.00.tar.gz
File already downloaded in /Users/taro/Library/Caches/Homebrew
/usr/bin/tar xf /Users/taro/Library/Caches/Homebrew/cdrtools-3.00.tar.gz
==> smake INS_BASE=/usr/local/Cellar/cdrtools/3.00 INS_RBASE=/usr/local/Cellar/cdrtools/3.00 install
smake INS_BASE=/usr/local/Cellar/cdrtools/3.00 INS_RBASE=/usr/local/Cellar/cdrtools/3.00 install
==> Exit Status: 1
http://github.com/mxcl/homebrew/blob/master/Library/Formula/cdrtools.rb#L11
==> Environment k
HOMEBREW_VERSION: 0.8.1
HEAD: bcdce506a4eac512a258e2dc85bfa133623100ca