Skip to content

Instantly share code, notes, and snippets.

View sahwar's full-sized avatar
💭
https://twitter.com/ve4ernik

sahwar

💭
https://twitter.com/ve4ernik
View GitHub Profile
@sahwar
sahwar / build_unix_dependencies.sh
Created June 4, 2020 01:57 — forked from roxlu/build_unix_dependencies.sh
Mac / Linux build script for open source libraries. Feel free to contact me http://www.twitter.com/roxlu for additions of fixes.
#!/bin/bash
# ----------------------------------------------------------------------- #
# I N F O
# ----------------------------------------------------------------------- #
#
#
# ********************************************************************** *
#
# Get the latest version of this file from:
@sahwar
sahwar / code.cpp
Created June 4, 2020 01:56 — forked from roxlu/code.cpp
Signature :)
---------------------------------------------------------------
oooo
`888
oooo d8b .ooooo. oooo ooo 888 oooo oooo
`888""8P d88' `88b `88b..8P' 888 `888 `888
888 888 888 Y888' 888 888 888
888 888 888 .o8"'88b 888 888 888
d888b `Y8bod8P' o88' 888o o888o `V88V"V8P'
@sahwar
sahwar / GUI.cpp
Created June 4, 2020 01:55 — forked from roxlu/GUI.cpp
Minimal AntTweakBar integration with GLFW
#include <assert.h>
#include <GLFW/glfw3.h>
#include <swnt/GUI.h>
GUI::GUI()
:win_w(0)
,win_h(0)
{
}
@sahwar
sahwar / compile.sh
Created June 4, 2020 01:54 — forked from roxlu/compile.sh
NGINX + PHP + MySQL
#!/bin/sh
# Compiling nginx + php + mysql on Mac OSX 10.9
# ---------------------------------------------
#
#
# CONFIGURE
# ---------------
# 1) Edit `conf/nginx.conf` and add this to the between the server { ... } config.
# NOTE: the current config you only need to uncomment the example that looks like this,
@sahwar
sahwar / Github Webhook Tutorial.md
Created April 30, 2020 06:55 — forked from jagrosh/Github Webhook Tutorial.md
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@sahwar
sahwar / gist:ba45cceedc8ea1f42eb50958673a9a9d
Created April 19, 2020 21:47 — forked from WizKid/gist:1170297
Remove comments in a JSON file
def removecomments(s):
inCommentSingle = False
inCommentMulti = False
inString = False
t = []
l = len(s)
i = 0
fromIndex = 0
@sahwar
sahwar / comments-trick.json
Created April 19, 2020 20:42 — forked from MoOx/comments-trick.json
How to make comment in JSON file
{
"//field": "These 'double quote' 'double quote' are used as comments, because JSON doesnt' allow comment",
"field": {},
"#another-field": "Another comment",
"another-field": {},
"/*stuff": "Be careful to use them when you have full control of the content :)",
"stuff": [],
"bla": "bla"
}
@sahwar
sahwar / broken.html
Created February 7, 2020 08:23 — forked from deoxxa/broken.html
cheerio parser killer
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8" /><meta name="description" content="A BitTorrent community focused on Eastern Asian media including anime, manga, music, and more." /><meta name="keywords" content="Daiz, anime, manga, music, Japan, Japanese, torrent, download, community" /><title>NyaaTorrents &#62;&#62; Torrent Information &#62;&#62; [AOT] Fullmetal Alchemist Brotherhood Full [Episodes 1-64 Complete Batch] [720p BD 100MB] | Anime, manga, and music - Just say the word</title><link rel="icon" type="image/png" href="http://files.nyaa.eu/favicon.png" /><link rel="stylesheet" type="text/css" href="http://files.nyaa.eu/www.css" title="CSS" /><link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://www.nyaa.eu/?page=rss" /><script src="http://files.nyaa.eu/functions.js" type="text/javascript"></script></head><body><div id="topbar"><div id="navbar"><ul id="tabnav"><li><a href="http://www.nyaa.eu/">Browse</a></li><li><a href="http://www.nyaa.eu/?page=upload">Upload</a></l
@sahwar
sahwar / rainbarf.zsh
Created February 4, 2020 05:38 — forked from creaktive/rainbarf.zsh
rainbarf sans tmux (to enable, "source rainbarf.zsh", under zsh)
# abort if already under tmux
[[ -n $TMUX_PANE ]] && return
# zsh-specific includes
zmodload -i zsh/datetime
zmodload -i zsh/stat
# place to store the chart
RAINBARF_OUT=~/.rainbarf.out
# update period, in seconds
#!/bin/bash
// https://gist.github.com/phiresky/5025490526ba70663ab3b8af6c40a8db
fname="$1"
cachedir=/tmp/pdfextract
mkdir -p "$cachedir"
mtime="$(stat -c %Y "$1")"