Skip to content

Instantly share code, notes, and snippets.

View anta40's full-sized avatar

Andre anta40

  • Jakarta, Indonesia
  • 06:10 (UTC +07:00)
View GitHub Profile
import React, { Component } from 'react';
import './App.css';
let lastScrollY = 0;
class StickyBar extends Component {
render(){
return (
<div>
<button type="button">Button 1</button>
@anta40
anta40 / sticky.html
Created July 12, 2018 03:10
Sticky bar demo
<!DOCTYPE html>
<html>
<head>
<script src="jquery-3.3.1.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
margin: 0;
font-family: Arial;
<!DOCTYPE html>
<html>
<head>
<script src="jquery-3.3.1.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
margin: 0;
font-family: Arial;
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import { StickyContainer, Sticky } from 'react-sticky';
class App extends React.Component {
render() {
return (
<StickyContainer>
{/* Other elements can be in between `StickyContainer` and `Sticky`,
# Configuration file for the Nim Compiler.
# (c) 2017 Andreas Rumpf
# Feel free to edit the default values as you need.
# You may set environment variables with
# @putenv "key" "val"
# Environment variables can be accessed like so:
# gcc.path %= "$CC_PATH"
public class NotificationUtil {
private static String TAG = NotificationUtil.class.getSimpleName();
private Context mContext;
public NotificationUtil(Context mContext) {
this.mContext = mContext;
}
@anta40
anta40 / MyFirebaseMessagingService.java
Created July 26, 2017 14:51
Firebase messaging service
public class MyFirebaseMessagingService extends FirebaseMessagingService {
private static final String TAG = MyFirebaseMessagingService.class.getSimpleName();
private NotificationUtil notificationUtil;
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.e(TAG, "From: " + remoteMessage.getFrom());
<html>
<head>
<title>Curve Test</title>
</head>
<style>
canvas { border: 1px solid red; }
</style>
<?php
class Firebase {
// sending push message to single user by firebase reg id
public function send($to, $message) {
$fields = array(
'to' => $to,
//'data' => $message,
@anta40
anta40 / MotionDetector.java
Created December 23, 2016 07:38
a simple motion detection using webcam in Java
import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.WebcamMotionDetector;
import com.github.sarxos.webcam.WebcamMotionEvent;
import com.github.sarxos.webcam.WebcamMotionListener;
import com.leacox.process.FinalizedProcess;
import com.leacox.process.FinalizedProcessBuilder;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;