Skip to content

Instantly share code, notes, and snippets.

View wzulfikar's full-sized avatar
💭
Set status

Wildan Zulfikar wzulfikar

💭
Set status
View GitHub Profile
@lifehome
lifehome / webhook.gs
Created August 24, 2016 14:48
Google Forms + Webhook : JSON example
function onFormSubmit(e) {
var data = {
"form": {
"id": e.source.getId(),
"title": e.source.getTitle() ? e.source.getTitle() : "Untitled Form",
"is_private": e.source.requiresLogin(),
"is_published": e.source.isAcceptingResponses(),
},
"response": {
"id": e.response.getId(),
@jzelinskie
jzelinskie / client.go
Last active October 27, 2021 03:37
grpc bidirectional streams in golang
package main
import (
"log"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
pb "github.com/jzelinskie/grpc/simple"
@drscotthawley
drscotthawley / greenscreen.py
Last active December 10, 2021 07:21
greenscreen.py: Greenscreen effect without a physical green screen, via OpenCV and Python
#! /usr/bin/env python
'''
greenscreen.py: Greenscreen effect without a physical green screen
This performs background subtraction, and sets the background to "green" for use with "key frame" video editing software
Author: Scott Hawley, https://github.com/drscotthawley
Requirements:
Python, NumPy and OpenCV
I got these via Macports, but Homebrew, etc. work.
@ota42y
ota42y / least_squares_method.go
Created February 2, 2015 22:59
Golang least squares method
package main
import "fmt"
type Point struct {
x float64
y float64
}
func LeastSquaresMethod(points *[]Point) (a float64, b float64){
@varver
varver / cookie_jar_golang.go
Last active June 7, 2022 13:04
Login to a website with this golang code using persistent cookies or cookie jar .
@Overdrivr
Overdrivr / Notes on C&C++ package managers.md
Last active July 15, 2022 19:33
Why C/C++ package managers fail for now ?

Motivation

As for now (mid 2016), there doesn't seem to be a C/C++ package manager that stands out of the crowd. To understand the reasons behind this failure, I will try to list in this README most C/C++ package managers, highlight differences between them, then list critics that are made about them.

Note: this README is merely a gathering of personnal notes, doesn't intend to be a reference in any way.

A standard proposal : http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0235r0.pdf

Package managers

@17twenty
17twenty / crazyOlSelectCase.go
Last active July 20, 2022 12:46
Using reflect.SelectCase - an example
package main
import (
"log"
"reflect"
"time"
)
func main() {
c1 := make(chan int)

SAMPLE

127.0.0.1 - - [26/Mar/2016:19:09:19 -0400] "GET / HTTP/1.1" 401 194 "" "Mozilla/5.0 Gecko" "-"

MATCH

%{IPORHOST:clientip} (?:-|(%{WORD}.%{WORD})) %{USER:ident} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-) %{QS:referrer} %{QS:agent} %{QS:forwarder}

Output

@steveliles
steveliles / embed.jsx
Created February 12, 2018 17:14
embedly with react.js
import React, {Component} from 'react'
import { connect } from 'react-redux'
// one-time init of the embedly platform.js, hidden behind
// typeof check not to blow up on server-side render
if (typeof window !== 'undefined') {
let init_embedly = function(w,d){
var id='embedly-platform', n = 'script';
if (!d.getElementById(id)){
w.embedly = w.embedly || function() {(w.embedly.q = w.embedly.q || []).push(arguments);};
@czj
czj / Gemfile
Last active August 28, 2022 09:06
Outputting Rails app logs to Logz.io via logstash
gem "lograge"
gem "logstash-event"
gem "logstash-logger"