Skip to content

Instantly share code, notes, and snippets.

View serefyarar's full-sized avatar

serefyarar

View GitHub Profile
@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
language: node_js
sudo: required
node_js:
- 10
services:
- docker
script:
- docker build -t DOCKER_ORG/IMAGE_NAME:DOCKER_TAG .
@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
@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 / 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 / _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 / FFmpeg Build Script (Amazon Linux)
Created October 4, 2015 18:24 — forked from thenadz/FFmpeg Build Script (Amazon Linux)
Downloads & builds FFmpeg along with all dependencies in parallel, enabling all features
#!/bin/bash -e
# Distro: Amazon Linux AMI release 2015.03
# Derived from https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
# Builds the dependencies in parallel prior to starting FFmpeg build.
sudo yum update -y
sudo yum install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel yasm libogg libvorbis-devel libvpx-devel
@serefyarar
serefyarar / DataArraySerializer.php
Created August 2, 2015 16:09
My Own Keyless Fractal Serializer
<?php
namespace App\Serializers;
use League\Fractal\Serializer\JsonApiSerializer;
use League\Fractal\Resource\ResourceInterface;
class DataArraySerializer extends JsonApiSerializer
{
/**
function Advertisement(category,media_id,frequency,duration){
this.category = category,
this.media_id = media_id;
this.frequency = frequency;
this.duration = duration;
this.getAds = function(){
var ads = [{time : 0, adTagUrl : this.getVast("preRoll")}];
var midrollCount = parseInt(this.duration/this.frequency);
for(i=1;i<=midrollCount;i++){
var midroll = {
@serefyarar
serefyarar / gist:32bc92f0902ed7dbe9a3
Created May 3, 2015 17:17
Çalışması lazım
<?php
$films = Film::with('roles','genre');
$title = Input::get('title',false);
if($title){
$films->where('title',$title);
}
$genre = Input::get('genre',false);
if($genre){