Skip to content

Instantly share code, notes, and snippets.

View serefyarar's full-sized avatar

serefyarar

View GitHub Profile
@serefyarar
serefyarar / _forward80.md
Created May 25, 2016 18:09 — forked from eddanger/_forward80.md
Port Forwarding from 80 to 8080 in Yosemite

Add com.coverall file to /etc/pf.anchors with:

rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port = 80 -> 127.0.0.1 port 8080
rdr pass on en0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass on en1 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass on en2 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080

Update pf.conf to point to this new file a-la:

@serefyarar
serefyarar / demo.js
Last active August 2, 2016 11:34
IMA SDK Custom Skip Button
player.on('ads.started',function(e){
skipButton(player.ima.getAdsManager(),{
'remaining' : 5,
'target' : '.video-js',
'btn_style' : {
'position': 'absolute',
'background': 'rgba(0, 0, 0, 0.85)',
'color': 'white',
'z-index': '9999999',
'border': '1px solid rgba(255,255,255,0.50)',
@serefyarar
serefyarar / script.lua
Created June 24, 2016 19:04
redis wildcard mget
local arg = "your_key*"
local cKeys = redis.call("KEYS",arg);
local cValues = redis.call("MGET",unpack(cKeys));
local cSet = {};
for key,value in pairs(cKeys) do
cSet[key] = {cKeys[key],cValues[key]};
end
return cSet
@serefyarar
serefyarar / wildcard-mget.lua
Created July 10, 2016 18:58
wildcard mget lua
local cKeys = redis.call("KEYS","your_key:*");
local cValues = redis.call("MGET",unpack(keys))
local cSet = {};
for key,value in pairs(cKeys) do
cSet[value] = cValues[key]
end
return cSet
language: node_js
sudo: required
node_js:
- 10
services:
- docker
script:
- docker build -t DOCKER_ORG/IMAGE_NAME:DOCKER_TAG .
@serefyarar
serefyarar / vpn-install.sh
Created March 9, 2022 14:43
Openconnect m1 mac install script
git clone https://gitlab.com/openconnect/openconnect.git
cd openconnect
brew install autoconf automake libtool pkg-config gettext openssl
./autogen.sh
sudo mkdir /etc/vpnc
sudo curl https://gitlab.com/openconnect/vpnc-scripts/raw/master/vpnc-script --output /etc/vpnc/vpnc-script
sudo chmod +x /etc/vpnc/vpnc-script
export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"
./configure
did:3:kjzl6cwe1jw149zw96t9xgvyurdk24zvx5eyyhaw61vmd08hk3tkx9dvlt21ans
@serefyarar
serefyarar / index.graphql
Created March 28, 2023 13:56
index schema 28
type Index @createModel(accountRelation: LIST, description: "A Simple Index"){
controller_did: DID! @documentAccount
title: String! @string(maxLength:1000)
version: CommitID! @documentVersion
collab_action: String @string(maxLength:150)
created_at: DateTime!
updated_at: DateTime!
deleted_at: DateTime
}
@serefyarar
serefyarar / main.action.ts
Last active May 23, 2023 07:34
Main Action
/**
* NAME: main
*/
import * as dagCBOR from '@ipld/dag-cbor';
import { sha256 } from 'multiformats/hashes/sha2';
import * as Block from 'multiformats/block';
const go = async () => {
/**
*
* NAME: main
*
*/
"use strict";
(() => {
var __defProp = Object.defineProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;