Skip to content

Instantly share code, notes, and snippets.

View ttpro1995's full-sized avatar
💭
meowingful

Thai Thien ttpro1995

💭
meowingful
View GitHub Profile
@ttpro1995
ttpro1995 / app_.gitignore
Created December 29, 2014 11:47
ListViewExaple
/build
Verifying that "hahattpro.id" is my Blockstack ID. https://onename.com/hahattpro
#!/usr/bin/env python3
'''
Here's how you upload an image. For this example, put the cutest picture
of a kitten you can find in this script's folder and name it 'Kitten.jpg'
For more details about images and the API see here:
https://api.imgur.com/endpoints/image
'''
# Thai Thien
# CORRECT SPECIFICATION:
#
# the Queue class provides a fixed-size FIFO queue of integers
#
# the constructor takes a single parameter: an integer > 0 that
# is the maximum number of elements the queue can hold.
#
# empty() returns True if and only if the queue currently
@ttpro1995
ttpro1995 / train_without_optim
Created May 3, 2017 11:48
Pytorch train without optim
import torch
import torch.nn as nn
from torch.autograd import Variable as Var
# define the data
dt = torch.Tensor([[1,0],[0,1], [1,1], [0,0]])
labels = torch.LongTensor([1, 0, 1, 0])
learning_rate = 0.01
model = nn.Linear(2,2)
criterion = nn.CrossEntropyLoss()
@ttpro1995
ttpro1995 / gist:b192d6918427270887e39ef819ea3576
Created August 14, 2017 15:59
English month of the year (short form)
Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct
import re
import dateparser
# use re and dateparser to normalize date in sentence
# :author: Thai Thien
def p1():
regex = r"\d+/\d+/\d+"
token = " today is 14/2/2012 which is meowing full day. Tomorrow is 15/2/2012, which is an meowingfull day again"
@ttpro1995
ttpro1995 / file1.txt
Created June 12, 2018 03:00
Created via API
Demo
@ttpro1995
ttpro1995 / file1.txt
Created June 12, 2018 03:04
Created via API
Demo
<!DOCTYPE html>
<html lang="en" ng-app="starApp">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="fragment" content="!">
<meta name="viewport" content="width=1024">
<title>188BET | Cược B&#243;ng Đ&#225; World Cup 2018</title>
<meta name="robots" content="" />
<meta name="keywords" content="world-cup, *" />