Skip to content

Instantly share code, notes, and snippets.

View BnayaZil's full-sized avatar

Bnaya Zilberfarb BnayaZil

View GitHub Profile
@BnayaZil
BnayaZil / gist:eb79e23dc8c4238027a6b115a76c373c
Last active June 5, 2019 10:33
Get request using Angular httpClient
//http://localhost:8080/GetPlayers?playerID=IHS
const params = new HttpParams().set('playerID',playerid)
const headers = new HttpHeaders({
'Content-Type': 'application/json'})
return this.http.get<{message: string, player : Player}>(`http://localhost:8080/GetPlayers`, {params, headers}).subscribe(
(res) => console.log(res),
(err) => console.error(err)
)
// factoryA.js
import FactoryB from './factoryB'
export default class FactoryA {
constructor(data) {
// ...
}
doStuffWithB(data, B = FactoryB) {
const b = new B()
//import java.awt.Point;
/**
* Polygon class, manage polygon state.
*
* @author Bnaya Zilberfarb
*/
public class Polygon
{
private PointNode _head;
@BnayaZil
BnayaZil / code03.js
Created June 3, 2017 21:45
Ramda series
import {prop, compose, apply, defaultTo, juxt, filter, gt, map} from 'ramda'
const players = [{
id: 1,
firstName: 'Bnaya',
age: 55,
file: {
img: 'http://foo.bar/bnaya-zil.png'
}
},
@BnayaZil
BnayaZil / code02.js
Created June 3, 2017 21:14
Ramda series
import {prop, compose, apply, defaultTo, juxt} from 'ramda'
const player = {
id: 1,
name: 'Bnaya',
file: {
img: 'http://foo.bar/bnaya-zil.png'
}
}
@BnayaZil
BnayaZil / code01.js
Created June 3, 2017 20:39
Ramda series
import {prop, compose} from 'ramda'
const player = {
id: 1,
name: 'Bnaya',
file: {
img: 'http://foo.bar/bnaya-zil.png',
thumb: 'http://foo.bar/bnaya-zil-thumb.png'
}
}
@BnayaZil
BnayaZil / 888_theme.js
Created May 4, 2017 10:12
888 Defaults Theme Settings
// # 888 Defaults Theme Settings
// # --------------------------------------------------------------------------
// #
{
level_widget: {
loading_bar_color: ['#000000', '#FFFF99', '#FF9A24', 'rgba(255,204,51,0)'],
background_color: '#EE0032',
text_color: '#FFFFFF',
},
notifications: {