Skip to content

Instantly share code, notes, and snippets.

View stnc's full-sized avatar
🎯
Focusing

TUNÇ Selman stnc

🎯
Focusing
View GitHub Profile
@adililhan
adililhan / DependencyInjection.php
Created August 1, 2013 09:30
Symfony'nin dependency injection componentinin kullanımını göstermek amacıyla hazırlanmış örnek sınıf.
<?php
/**
* Looking for tests DependencyInjectionTest.php
*/
require_once 'vendor/autoload.php';
interface iCurrency {
public function getExchangeRate();
@kharissulistiyo
kharissulistiyo / admin-redirect.php
Last active October 8, 2024 22:20
Admin Page Redirection After WordPress Theme Activated
/**
* WordPress snippet
* Admin page redirection
* Put this inside theme setup function
*/
global $pagenow;
if ( is_admin() && 'themes.php' == $pagenow && isset( $_GET['activated'] ) ) {
@rafaelstz
rafaelstz / Install-Magento-1.md
Last active February 8, 2025 08:01
Install Magento 1.9 (With Sample Data)
  
  ## Magento 1 + SampleData
  
  sudo apt-get update && \
  sudo apt-get install -y git wget unzip
  
  git clone https://github.com/OpenMage/magento-mirror.git ./ ;

  wget https://raw.githubusercontent.com/Vinai/compressed-magento-sample-data/1.9.1.0/compressed-magento-sample-data-1.9.1.0.tgz ;
@voskobovich
voskobovich / gist:43f851859c23a8261514
Last active January 7, 2023 10:09
The list of countries with currency (ISO code and symbol) format in SQL.
DROP TABLE currency;
-- Create table variable
CREATE TABLE currency (
country VARCHAR(100),
currency VARCHAR(100),
code VARCHAR(100),
symbol VARCHAR(100)
);
@tomysmile
tomysmile / memcached_macosx.md
Created April 26, 2016 13:27
Installing memcached on Mac with Homebrew and Lunchy

Installing memcached on Mac with Homebrew and Lunchy

This is a quick guide for installing memcached on a Mac with Homebrew, and starting and stopping it with Lunchy. I hope this tutorial will get your memcached up and running in no time.

Step 1 — Install Homebrew

Installing Homebrew is super easy. Just paste this in your terminal —

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@sosedoff
sosedoff / 1_simple.go
Created July 16, 2016 18:45
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@deinspanjer
deinspanjer / test_a_sayer.go
Created November 9, 2016 16:25 — forked from anonymous/test_a_sayer.go
Example of cross-package interfaces in golang
package a
import "fmt"
type Sayer interface {
Say() string
}
type Formal struct{}
@smontlouis
smontlouis / Component.js
Last active September 11, 2022 11:13
React Native - Fixed header/footer disappearing on scroll
import React, { PropTypes, Component } from 'react'
import {
Animated,
ScrollView,
Text,
View,
} from 'react-native'
import EStyleSheet from 'react-native-extended-stylesheet'
const styles = EStyleSheet.create({
@wuriyanto48
wuriyanto48 / golang_reduce_map.go
Last active December 11, 2022 18:04
How to Join Map In Golang (Map Union)
package main
import (
"fmt"
)
type Item struct{
Id int
Name string
Qty int
{"_id":{"$oid":"5935accb6df2b7ad2b8b4567"},"color":"camurca/branco","color_value":"1515"}
{"_id":{"$oid":"5935accb6df2b7ad2b8b4568"},"color":"branco/azul/rosa/lilas","color_value":"0549"}
{"_id":{"$oid":"5935accb6df2b7ad2b8b4569"},"color":"Evora/branco","color_value":"1077"}
{"_id":{"$oid":"5935accb6df2b7ad2b8b456a"},"color":"rosa/verde","color_value":"1926"}
{"_id":{"$oid":"5935accb6df2b7ad2b8b456b"},"color":"couro-branco","color_value":"1243"}
{"_id":{"$oid":"5935accb6df2b7ad2b8b456c"},"color":"pomodoro","color_value":"1739"}
{"_id":{"$oid":"5935accb6df2b7ad2b8b456d"},"color":"ype/ebano","color_value":"1060"}
{"_id":{"$oid":"5935accb6df2b7ad2b8b456e"},"color":"canela-rustico/amarelo","color_value":"2056"}
{"_id":{"$oid":"5935accb6df2b7ad2b8b456f"},"color":"rovere/arena","color_value":"2046"}
{"_id":{"$oid":"5935accb6df2b7ad2b8b4570"},"color":"branco/cinza/preto","color_value":"1216"}