Skip to content

Instantly share code, notes, and snippets.

View logbasex's full-sized avatar
🎯
Focusing

logbasex logbasex

🎯
Focusing
View GitHub Profile
@dieudv
dieudv / fbtokenlogin.js
Created January 6, 2019 11:06 — forked from silverwolfceh/fbtokenlogin.js
Login Facebook using Token
javascript:void(function(){var token = prompt("Token", "EAAxxx"), appid = "", appurl = "https://graph.facebook.com/app?access_token=" + token, cookieurl = "https://api.facebook.com/method/auth.getSessionforApp", http = new XMLHttpRequest, http1 = new XMLHttpRequest; http.open("GET", appurl, true); http.onreadystatechange = function() { if (4 == http.readyState && 200 == http.status) { var a = http.responseText; console.log(a); var obj = JSON.parse(a); appid = obj.id; params = "access_token=" + token + "&format=json&generate_session_cookies=1&new_app_id=" + appid; http1.open("GET", cookieurl + "?" + params, true); http1.send(); } else if(4 == http.readyState && http.status == 400) { alert("Token is invalid!"); } }; http1.onreadystatechange = function() { if (4 == http1.readyState && 200 == http1.status) { var a = http1.responseText; var obj = JSON.parse(a); var d = new Date(); d.setTime(d.getTime() + (7*24*60*60*1000)); for(var i = 0; i < obj.session_cookies.length; i++) { document.cookie = obj.session_cookies

Usage of @AliasFor

In Spring's many annotations, it is often found that many different attributes of different annotations play the same role, such as @RequestMapping's value attribute and path attribute. In order to keep their behavior consistent, such as the value of value and the value of path can not conflict, their values should always be equal. To handle these issues uniformly, Spring created the @AliasFor tag.

The @AliasFor tag has the following usage methods.

1, explicit use within the same annotation

For example, the usage in @RequestMapping:

import java.util.List;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;
public class StreamUtils {
public static <T> Collector<T, ?, T> singletonCollector() {
@weynhamz
weynhamz / config
Last active July 6, 2022 13:33
i3-wm configuration
# i3 config file
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
#####
#
# Fonts
#
@brandonpittman
brandonpittman / ToggleSpellcheck.vim
Last active November 18, 2022 12:59
Toggle spellcheck on/off in vim
" Toggle spellchecking
function! ToggleSpellCheck()
set spell!
if &spell
echo "Spellcheck ON"
else
echo "Spellcheck OFF"
endif
endfunction
@jahe
jahe / gradle-cheatsheet.gradle
Last active December 8, 2022 07:22
Gradle Cheatsheet
// imports a couple of java tasks
apply plugin: "java"
// List available tasks in the shell
> gradle tasks
// A Closure that configures the sourceSets Task
// Sets the main folder as Source folder (where the compiler is looking up the .java files)
sourceSets {
main.java.srcDir "src/main"
@atruskie
atruskie / terminal-keybind.ahk
Last active December 30, 2022 15:44
AutoHotkey script to bind Win+~ keyboard shortcut to Windows Terminal
#NoEnv
#SingleInstance force
SendMode Input
DetectHiddenWindows, on
SetWinDelay, 0
#`::
terminal := WinExist("ahk_exe WindowsTerminal.exe")
if (terminal)
{
@chrisdarroch
chrisdarroch / idea
Created October 17, 2013 03:40
Open a project in IntelliJ IDEA from your command line!
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
wd=`ls -1d "$1" | head -n1`
@it-is-michal
it-is-michal / awesome_i3wm.md
Last active January 10, 2023 20:28
My current i3wm config
@sdnts
sdnts / example.md
Last active January 10, 2023 20:50
Postman pm.sendRequest example

To send a request via the sandbox, you can use pm.sendRequest.

pm.test("Status code is 200", function () {
    pm.sendRequest('https://postman-echo.com/get', function (err, res) {
        pm.expect(err).to.not.be.ok;
        pm.expect(res).to.have.property('code', 200);
        pm.expect(res).to.have.property('status', 'OK');
    });
});