Skip to content

Instantly share code, notes, and snippets.

Avatar
💬
I'm using skype, see you again.

umut yerebakmaz umutyerebakmaz

💬
I'm using skype, see you again.
View GitHub Profile
View macosx_remove_java9.sh
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
@msmfsd
msmfsd / es7-async-await.js
Last active Feb 8, 2021
Javascript fetch JSON with ES7 Async Await
View es7-async-await.js
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved
@dtomasi
dtomasi / default
Last active Feb 23, 2021
Brew Nginx PHP7
View default
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@dimitardanailov
dimitardanailov / sample-nginx.conf
Last active Jan 8, 2020
Configuration for Laravel 5 application and Nginx
View sample-nginx.conf
server {
listen 80 default deferred;
server_name laravel-application.com;
# http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log
access_log /var/www/laravel-app/access.log;
error_log /var/www/laravel-app/error.log;
root /var/www/laravel-app/public/;
View ifconfig.php
<?php
function ifconfig() {
preg_match("/^([A-z]\*\d)\s+Link\s+encap:([A-z]\*)\s+HWaddr\s+([A-z0-9:]\*).\*".
"inet addr:([0-9.]+).\*Bcast:([0-9.]+).\*Mask:([0-9.]+).*".
"MTU:([0-9.]+).\*Metric:([0-9.]+).\*".
"RX packets:([0-9.]+).\*errors:([0-9.]+).\*dropped:([0-9.]+).\*overruns:([0-9.]+).\*frame:([0-9.]+).*".
"TX packets:([0-9.]+).\*errors:([0-9.]+).\*dropped:([0-9.]+).\*overruns:([0-9.]+).\*carrier:([0-9.]+).*".
"RX bytes:([0-9.]+).\*\((.\*)\).*TX bytes:([0-9.]+).\*\((.\*)\)".
"/ims", $int, $regex);
@cschaba
cschaba / gist:4740380
Created Feb 8, 2013
PHP: parse output of ifconfig (tested with Ubuntu Linux)
View gist:4740380
<?php
// from http://www.highonphp.com/regex-pattern-parsing-ifconfig
$data = <<<EOF
eth0 Link encap:Ethernet HWaddr 00:50:56:33:B6:D2
inet addr:192.168.12.103 Bcast:192.168.12.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1337 errors:0 dropped:0 overruns:0 frame:0
TX packets:985 errors:0 dropped:0 overruns:0 carrier:0