Skip to content

Instantly share code, notes, and snippets.

@Kaz-su
Kaz-su / minified.js
Created May 19, 2020 14:28
健食の糞LPの糞コード
var second=0;var customerCount=(Math.random()*50);customerCount=Math.floor(customerCount);var productCount=4;var productCount2=6;$(document).ready(function(){$('#footer-slider').fadeIn();second=getCookie();console.log(document.cookie);if(isNaN(second)){second=7200;};CustomerIncrement();ProductDecrement();CountDown();setInterval("CustomerIncrement()",3000);setInterval("CountDown()",1000);});function Rand_View_Num(){randNum=(Math.random()*8)-3;randNum=Math.floor(randNum);customerCount=customerCount+randNum;if(customerCount>999){customerCount=999;}if(customerCount<3){customerCount=3;}}function CustomerIncrement(){Rand_View_Num();var nowdate=new Date();var hour=nowdate.getHours();var min=nowdate.getMinutes();jQuery('#slider1 p').html(hour+"時"+min+"分現在あなたの他に<span class='blink' style='color:#ffff00;font-weight:bold;'>"+customerCount+"</span>人が見ています");jQuery('#slider3 p').html(hour+"時"+min+"分現在あなたの他に<span class='blink' style='color:#ffff00;font-weight:bold;'>"+customerCount+"</span>人が見ています");}function ProductDecreme
@Kaz-su
Kaz-su / index.js
Created February 14, 2020 08:59
Cloud Functions で HTTP POST リクエストを受けて Firestore に書き込む例
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
var fireStore = admin.firestore();
exports.helloWorld = functions.https.onRequest((request, response) => {
if (request.method !== 'POST') {
response.status(405).send('method not allowed');
@Kaz-su
Kaz-su / daily.js
Last active August 13, 2019 09:46
誰かのツイートが消えてないか監視するやつ(GAS)
// Queryfeed でチャンネルにツイートを垂れ流している場合のみ利用可能
var token = '{slack-token}';
var channelID = '{channel-id}';
var userName = '{user-name}'; // @realDonaldTrump とか
function myFunction() {
var latest = Math.floor(new Date().getTime() / 1000);
var oldest = latest - 24 * 60 * 60;
var url = 'https://slack.com/api/channels.history?channel=' + channelID + '&oldest=' + oldest + '&latest=' + latest;
@Kaz-su
Kaz-su / upload_am2320data_to_firebase_realtime_database.py
Last active November 26, 2018 09:29
upload am2320 data (temperature and humidity) to firebase realtime database.
#!/usr/bin/env python
import smbus
import time
from datetime import datetime
from firebase import firebase
from pytz import timezone
i2c = smbus.SMBus(1)
address = 0x5c