Skip to content

Instantly share code, notes, and snippets.

View SergeyPodgornyy's full-sized avatar
😎
When I get sad, I stop being sad and be AWESOME instead!....True Story!

Sergey Podgornyy SergeyPodgornyy

😎
When I get sad, I stop being sad and be AWESOME instead!....True Story!
View GitHub Profile
@ManInTheBox
ManInTheBox / DateTimeImmutabilityExample.php
Created November 8, 2016 14:47
DateTime VS DateTimeImmutable example
<?php
class DateTimeImmutabilityExample
{
private $date;
/**
* Intentionaly no type hinting so you can test with both DateTime and DateTimeImmutable
*/
public function __construct($date)
@iturgeon
iturgeon / README.md
Last active October 30, 2023 14:06
How to run phpMyAdmin using the built in php webserver

Running phpMyAdmin localy on the built in php server

  1. make sure you have php 5.3+: run php -v
  2. Download phpmyadmin (github or main website)
  3. In the root directory, copy config.sample.inc.php > config.inc.php
  4. Edit config.inc.php, set $cfg['Servers'][$i]['host'] to the ip address of your mysql server (probably localhost or 127.0.0.1)
  5. In the root phpmyadmin directory run php -S localhost:8080
  6. open in your browser: http://localhost:8080
  7. log in by entering some valid credentials (a user you added or the root user)
@stoewer
stoewer / ToSnakeCase.go
Last active March 29, 2022 16:59
Convert camel case to snake case in Go http://play.golang.org/p/9ybqJat1Hr
import (
"fmt"
"strings"
"regexp"
)
var matchFirstCap = regexp.MustCompile("(.)([A-Z][a-z]+)")
var matchAllCap = regexp.MustCompile("([a-z0-9])([A-Z])")
@SerhiiLihus
SerhiiLihus / bonfire-factorialize-a-number.js
Last active August 11, 2023 14:01
Factorialize a Number
// Bonfire: Factorialize a Number
// Author: @serhiilihus
// Challenge: http://www.freecodecamp.com/challenges/bonfire-factorialize-a-number
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function factorialize(num) {
return ( num === 1 || num === 0 ) ? 1 : num * factorialize(num - 1);
}
@roachhd
roachhd / README.md
Last active May 18, 2024 00:26
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 17, 2024 12:37
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@snowman-repos
snowman-repos / gist:3825198
Created October 3, 2012 05:28
JavaScript: Detect Orientation Change on Mobile Devices
// Listen for orientation changes
window.addEventListener("orientationchange", function() {
// Announce the new orientation number
alert(window.orientation);
}, false);
// Listen for resize changes
window.addEventListener("resize", function() {
// Get screen size (inner/outerWidth, inner/outerHeight)