This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isProxy = obj => { | |
try { | |
let test = {obj : true} | |
test[obj] = false | |
} catch { | |
return true | |
} | |
return false | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Submitted for verification at BscScan.com on 2022-02-24 | |
*/ | |
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.6.0 <0.8.0; | |
/* | |
* @dev Provides information about the current execution context, including the | |
* sender of the transaction and its data. While these are generally available |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- place the snippets in your ~/.hammerspoon/init.lua | |
local sys_key = { | |
[3] = {pos = 1, key = 'F1'}, -- BRIGHTNESS_DOWN | |
[2] = {pos = 2, key = 'F2'}, -- BRIGHTNESS_UP | |
[22] = {pos = 5, key = 'F5'}, -- ILLUMINATION_DOWN | |
[21] = {pos = 6, key = 'F6'}, -- ILLUMINATION_UP | |
[20] = {pos = 7, key = 'F7'}, -- REWIND | |
[16] = {pos = 8, key = 'F8'}, -- PLAY | |
[14] = {pos = 9, key = 'F9'}, -- FAST |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"html" | |
"log" | |
"net/http" | |
"os" | |
"strings" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- === HoldToQuit === | |
--- | |
--- Instead of pressing ⌘Q, hold ⌘Q to close applications. | |
local obj = {} | |
obj.__index = obj | |
-- Metadata | |
obj.name = "HoldToQuit" | |
obj.version = "1.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
"path/filepath" | |
"strings" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface TimerObj { | |
id : number; | |
func : (...params) => void; | |
interval : number; | |
loop : number; | |
forever : boolean; | |
params : Array<any>; | |
count : number; | |
finished : boolean; | |
call_time : number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function gen() | |
local arr = {} | |
for i = 1, 9 * 9 do | |
arr[i] = i > 25 and 0 or i | |
end | |
return arr | |
end | |
local function pr(arr) | |
local r = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define MAGIC_TAG 0x11223344 | |
inline static void* my_malloc(int size) { | |
void* ptr = malloc(size + sizeof(MAGIC_TAG)); | |
int *p = (int *) ptr; | |
*p = MAGIC_TAG; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
struct tval { | |
int v; | |
int i; | |
}; | |
struct minstack { |
NewerOlder