Skip to content

Instantly share code, notes, and snippets.

View falahati's full-sized avatar
🥱
I may be slow to respond

Soroush falahati

🥱
I may be slow to respond
View GitHub Profile
@anthonysomerset
anthonysomerset / fastcgi_params
Created November 10, 2011 11:08
nginx https if statement for fastcgi_params
set $ssl off;
if ($ssl_protocol != "" ) {
set $ssl on;
}
fastcgi_param HTTPS $ssl;
@tobedoit
tobedoit / gist:4146942
Created November 26, 2012 06:59
Wordpress: remove the "Dashboard" and redirect for non-admin user
/* Remove the "Dashboard" from the admin menu for non-admin users **********************************
** http://wordpress.stackexchange.com/questions/52752/hide-dashboard-from-non-admin-users ******* */
/* !관리자 아닌 회원 알림판 제거 & 리다이렉트 *********************************************************** */
function custom_remove_dashboard () {
global $current_user, $menu, $submenu;
get_currentuserinfo();
if( ! in_array( 'administrator', $current_user->roles ) ) {
reset( $menu );
$page = key( $menu );
@ameerkat
ameerkat / MD5.cs
Created October 29, 2016 08:35
MD5 Implementation in C# based on Wikipedia psuedocode
using System;
using System.Linq;
namespace MD5
{
/// <summary>
/// RFC for MD5 https://tools.ietf.org/html/rfc1321
/// Based on the pseudo code from Wikipedia: https://en.wikipedia.org/wiki/MD5
/// </summary>
public class MD5
@amasover
amasover / 0 HeliosDisplayManagementGuide.md
Last active May 21, 2018 23:38
Working surround profile + auxiliary monitors for use with HeliosDisplayManagement

Here are the steps that worked for me to setup HeliosDisplayManagement for an NVidia Surround arrangement and a non-surround arrangement.

  1. Download installer from the releases page.

  2. Run Helios Display Management, and click "clone", then edit the cloned arrangement and change the name to what you want (can also be done through editing xml. Do this again for the other monitor arrangement (e.g., clone a surround arrangement, then turn off surround through NVidia control panel, then clone the non-surround arrangement).

@tiernan
tiernan / serviceworker.d.ts
Last active June 10, 2023 10:59
Service Worker Typings to Supplement lib.webworker.ts
/**
* Copyright (c) 2018, Tiernan Cridland
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby
* granted, provided that the above copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
@serg0x
serg0x / material-design-shadows.css
Last active July 7, 2023 13:33
Google material design elevation system shadows as css. Based on https://material.io/design/environment/elevation.html#default-elevations Exported with Sketchapp from the Google material design theme editor plugin "Baseline" theme.
/* Shadow 0dp */
box-shadow: none;
/* Shadow 1dp */
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.20);
/* Shadow 2dp */
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.20);
/* Shadow 3dp */