Skip to content

Instantly share code, notes, and snippets.

Yehonatan Levi leviyehonatan

Block or report user

Report or block leviyehonatan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Service.js
import React, { useState } from 'react';
import { Form, Header, Segment, Dropdown, Label, Button } from 'semantic-ui-react';
import { Query, Mutation } from 'react-apollo';
import gql from 'graphql-tag';
import MembersSelectionBox from './MembersSelectionBox';
export default ({ id, onSaved }) => {
const [name, setName] = useState();
return (
View docker-compose.yml
version: "3"
image: node:8
- ./:/app
working_dir: /app
- mongo
leviyehonatan / app_v2.js
Last active Jan 29, 2019
my problem with flatlist overflow
View app_v2.js
import {Animated, Dimensions, NativeModules, Platform, StyleSheet} from 'react-native';
import {formStyle} from './forms';
import {FEED} from './app';
import DeviceInfo from 'react-native-device-info';
import * as config from '../config';
const { StatusBarManager } = NativeModules;
const WIDTH = Dimensions.get('window').width;
const HEIGHT = Dimensions.get('window').height;
View Alarm.kt
fun setExactAlarm(type: Int, triggerAtMillis: Long, operation: PendingIntent ) {
if (Build.VERSION.SDK_INT >= 23)
alarmManager.setExactAndAllowWhileIdle(type, triggerAtMillis, operation)
else if (Build.VERSION.SDK_INT >= 19)
alarmManager.setExact(type, triggerAtMillis, operation)
alarmManager.set(type, triggerAtMillis, operation)
setExactAlarm(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + (1000 * notification.active_after),
leviyehonatan / PersistentCookieStore.kt
Last active May 23, 2016
This is a kotlin implementation of a persistent cookie store for android, using SharedPreferences and Gson for the actual persistence
View PersistentCookieStore.kt
internal class PersistentCookieStore(val context: Context) : CookieStore {
inner class DatedCookie(val cookie: HttpCookie, val creationDate: Date)
val SP_COOKIE_STORE = "cookieStore"
val cookieSharedPreferences = context.getSharedPreferences(SP_COOKIE_STORE, Context.MODE_PRIVATE)
leviyehonatan / AndroidManifests.xml
Last active Feb 17, 2016
a reproduction of a scenario which produces a problem with robolectric ShadowBroadcastReceiver
View AndroidManifests.xml
<manifest xmlns:android=""
<application android:allowBackup="true" android:label="@string/app_name">
<receiver android:name=".Receiver" >
<action android:name="com.test.message" />
leviyehonatan / somecode.swift
Created Jun 15, 2015
reading and writing to my logfile
View somecode.swift
func existingLog() -> String? {
if let logFileHandle = NSFileHandle(forReadingAtPath: logFile) {
let data = logFileHandle.readDataToEndOfFile()
return NSString(data:data, encoding:NSUTF8StringEncoding) as String?
return nil
func log(log: String) {
let logLine = "\(NSDate()) \(log)\n"
leviyehonatan /
Last active Aug 29, 2015
gson serialization yields null
package test;
import java.util.List;
public class LoginInfo {
public class DeviceInfo {
public String deviceId;
public String deviceType;
public String deviceOs;
public int deviceVersion;
leviyehonatan /
Last active Aug 29, 2015
some location logger
import pymongo
import json
import os
from datetime import datetime
from itertools import chain
from pprint import pprint
from flask import Flask, session, request, abort, make_response
app = Flask(__name__)
View deafult.html.jade
each doc in getCollection('documents').findAll({nav : { $exists : true}}).toJSON()
!= doc.nav
You can’t perform that action at this time.