Skip to content

Instantly share code, notes, and snippets.

View stnc's full-sized avatar
🎯
Focusing

TUNÇ Selman stnc

🎯
Focusing
View GitHub Profile
@cagartner
cagartner / customer-checkout-magento.phtml
Created October 20, 2017 12:47
Verify if user is in checkout proccess
<?php if ($this->helper('Magento\Checkout\Helper\Data')->isContextCheckout()): ?>
<input name="context" type="hidden" value="checkout" />
<?php endif; ?>
@shamimmoeen
shamimmoeen / custom-file-upload-form-in-wordpress.php
Last active October 31, 2023 10:42
Create custom file upload form in WordPress
<?php
if ( ! function_exists( 'wpcfu_output_file_upload_form' ) ) {
/**
* Output the form.
*
* @param array $atts User defined attributes in shortcode tag
*/
function wpcfu_output_file_upload_form( $atts ) {
@jvandenaardweg
jvandenaardweg / App.jsx
Last active November 19, 2020 22:41
Use React's Context API in React Native (0.59.0) to have network connectivity status globally available. Gist for Medium article: https://medium.com/@jvandenaardweg/easily-manage-connection-status-updates-in-react-native-28c9b4b0647f
import React from 'react';
import { NetworkProvider } from './NetworkProvider';
import { ExampleComponent } from './ExampleComponent';
export default class App extends React.PureComponent {
render() {
return (
<NetworkProvider>
<ExampleComponent />
@uguraktas
uguraktas / jspromises.js
Last active October 17, 2019 15:11
Javascript Callback, promise and await
//Dummy data
const data = [
{ title: "Title 1", description: "Title Content 1" },
{ title: "Title 2", description: "Title Content 2" }
]
//Example Callback
function getData() {
setTimeout(() => {
data.map((item, index) => {
console.log('getData', item, index)
@pkkid
pkkid / sort-photos-by-month.py
Created April 3, 2024 23:09
Sort Photos by Month
#!/usr/bin/python3
"""
Sort Photos by Month.
install python3-pil
"""
import logging, datetime
import argparse, os, sys
import hashlib
from PIL import Image