Skip to content

Instantly share code, notes, and snippets.

View makiftutuncu's full-sized avatar
💭
🤘🏻

Mehmet Akif Tütüncü makiftutuncu

💭
🤘🏻
View GitHub Profile
@johnhungerford
johnhungerford / getEither.scala
Last active March 27, 2024 12:08
Kotlin/TypeScript -like syntax for accessing nested optional types
//> using scala 3.3
import scala.util.{Failure, NotGiven, Success, Try, boundary}
import boundary.{Label, break}
import scala.annotation.targetName
/**
* Proof of concept implementation of a syntax similar to Kotlin and
* typescript. Within the context provided by [[getEither]], you can call
* `?` on any optional/failable type (currently supports [[Option]],
@baptx
baptx / instagram-api_send_message.js
Last active May 29, 2024 08:21
Instagram API: send direct messages from a web browser
/*
Instagram API: send direct messages from a web browser
Since April 2020, Instagram has a web version to send and read direct messages so my Instagram scripts are not longer needed and I would not recommend using them unless you really need it, to avoid being banned
(never happened to me with Instagram but WhatsApp is owned by Facebook also and they did it to users registering from an unofficial app like yowsup: https://github.com/tgalal/yowsup/commit/88b8ad9581fa22dac330ee3a05fec4e485dfa634#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5)
For browser setup, see script instagram-api_direct_messages_backup.js
Instagram web version sessionid cookie does not allow sending messages so we need to log in manually
Signature should match signed_body data (using HMAC-SHA256 with private key) but wrong signature or key may work also.
@nickbutcher
nickbutcher / avd_loading_bar.xml
Last active September 21, 2020 00:38
A prototype of a loading indicator utilizing repeated gradients. See https://twitter.com/crafty/status/914830571196571648
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License
@riza
riza / ys.js
Last active May 28, 2021 20:13
yemeksepeti random yemek seçici
/* Chrome eklentisi de şurada : https://github.com/riza/yemeksepeti-randomer */
var items = []; $('.ys-item').find('.head').find('.restaurantName').each(function(i,v) { items.push($(this).html()); });console.log(items[Math.floor(Math.random()*items.length)]);
@olih
olih / jq-cheetsheet.md
Last active July 16, 2024 23:02
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active July 12, 2024 09:40
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@PurpleBooth
PurpleBooth / README-Template.md
Last active July 25, 2024 06:10
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@cdmckay
cdmckay / MultipartFormDataWriteableExample.scala
Created June 24, 2015 05:04
An example of how to use MultipartFormDataWriteable
import play.api.libs.ws.WS
import play.api.mvc.MultipartFormData.FilePart
import play.api.mvc.MultipartFormData
import utilities.MultipartFormDataWriteable._
...
val url = "https://example.com"
val dataParts = Map(
@cdmckay
cdmckay / MultipartFormDataWriteable.scala
Created June 24, 2015 04:39
Add support for MultipartFormData to the Play Scala WS library
package utilities
import java.io.{ByteArrayOutputStream, File}
import com.ning.http.client.FluentCaseInsensitiveStringsMap
import com.ning.http.multipart.{MultipartRequestEntity, FilePart, StringPart}
import play.api.http.HeaderNames._
import play.api.http.{ContentTypeOf, Writeable}
import play.api.mvc.{Codec, MultipartFormData}
package controllers
import env.Env
import play.api.libs.json.JsArray
import play.api.mvc._
import play.api.libs.concurrent.Execution.Implicits._
// here's where the injection takes place
class Application(env: Env) extends Controller {
import env._ // to avoid writing something like env.WS.url() or env.configuration.get...