Skip to content

Instantly share code, notes, and snippets.

View tpaksu's full-sized avatar
🐰
Follow the white rabbit. Also, 🍌!

Taha Paksu tpaksu

🐰
Follow the white rabbit. Also, 🍌!
View GitHub Profile
@lassaadbaati
lassaadbaati / Debian server setup script (PHP 7.1)
Last active May 10, 2019 11:22 — forked from Ravaelles/Ubuntu server setup script (PHP 7.1)
PHP 7.1 + nginx + MongoDB driver for PHP
#!/bin/bash
######################################################
### README ###########################################
######################################################
###
### One-line server install script for Ubuntu.
### Installs Nginx + PHP7.1 + MongoDB for PHP driver.
###
### Removes previous Apache, PHP, nginx installations.
@tpaksu
tpaksu / renew.sh
Created January 19, 2018 07:35
laragon refresh certificates
#!/bin/sh
CRTPATH=$(pwd -W)
for i in *.key ; do
DOMAIN=${i%.key}
cat << EOF > openssl_$DOMAIN.conf
[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
[req_distinguished_name]
@orenmizr
orenmizr / utils.js
Created January 7, 2017 01:27
extend
// merge two objects to one merged object;
var extend = function(defaults, options) {
var extended = {};
copyObj(extended, defaults);
copyObj(extended, options);
// var prop;
// for (prop in defaults) {
// if (Object.prototype.hasOwnProperty.call(defaults, prop)) {
// extended[prop] = defaults[prop];
// }
@mhulse
mhulse / javascript-plugin-patterns-FOUND-protoytpe-newed.js
Last active May 16, 2021 14:45
Some of my favorite JavaScript plugin design patterns: The Facade Pattern, The Revealing Module Pattern, Immediately-invoked Function Expressions (IIFE)s, The Module Pattern imports and exports
// http://callmenick.com/post/slide-and-push-menus-with-css3-transitions
(function(window) {
'use strict';
/**
* Extend Object helper function.
*/
function extend(a, b) {
@ashleydw
ashleydw / nginx.conf
Last active June 19, 2024 17:08
Laravel nginx conf file
server {
listen 80 default_server;
server_name example.com www.example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public;
index index.php index.html;
@sindresorhus
sindresorhus / post-merge
Last active May 2, 2024 03:18
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@MarcDiethelm
MarcDiethelm / Contributing.md
Last active July 6, 2024 13:12
How to contribute to a project on Github

This text now lives at https://github.com/MarcDiethelm/contributing/blob/master/README.md. I turned it into a Github repo so you can, you know, contribute to it by making pull requests.


Contributing

If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.

@MattKetmo
MattKetmo / google-sign.php
Created October 9, 2013 08:16
Google Maps Sign URL
#!/usr/bin/env php
<?php
/**
* @see https://github.com/geocoder-php/Geocoder/blob/21e562a5ad595c6fee7a33ae90e0b42dc8866c23/src/Geocoder/Provider/GoogleMapsBusinessProvider.php#L82
*/
function signQuery($query, $privateKey)
{
$url = parse_url($query);
@derek-watson
derek-watson / simple-throttle.js
Created August 14, 2012 14:44
Simple javascript function throttling
var isThrottled = false,
throttleDuration = 24; // ms
function thingToThrottle() {
if (isThrottled) { return; }
isThrottled = true;
setTimeout(function () { isThrottled = false; }, throttleDuration);
// do your work here
}